MSHFlexGrid控件问题。小妹及用,请各位大哥哥帮帮忙。
rec.Open ssql, conn, adOpenKeyset, adLockOptimistic, adCmdText
If Not rec.EOF Then
Set MSHFlexGrid1.DataSource = rec
Jd = DatePart("m", Now) - 1
TMonth = CStr(Jd) & "-26"
zc = DatePart("ww", TMonth)
For i = 1 To MSHFlexGrid1.Rows - 1
MSHFlexGrid1.TextMatrix(i, 0) = Val(MSHFlexGrid1.TextMatrix(i, 0)) - zc + 1
Select Case Me.MSHFlexGrid1.TextMatrix(i, 0)
Case 1
Me.Picture1.CurrentX = 5150 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf1 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 2
Me.Picture1.CurrentX = 5650 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf2 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 3
Me.Picture1.CurrentX = 6150 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf3 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 4
Me.Picture1.CurrentX = 6650 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf4 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
Case 5
Me.Picture1.CurrentX = 7150 * 0.5
Me.Picture1.CurrentY = 6500 * 0.5
Me.Picture1.Print (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
yf5 = (Me.MSHFlexGrid1.TextMatrix(i, 1)) * 1 + (Me.MSHFlexGrid5.TextMatrix(i, 1)) * 1
End Select
Next
End If
rec.Close
这段代码在运行的时候只要。msh1和MSH5的行数不一样。或都MSH5为空。就会出错。我相请各位大哥哥帮帮忙怎样让msh1 和MSH5的行数都固定为6行。小妹急用。请各位大哥哥,一定帮帮小妹。