Adodc2.RecordSource = "select id as 编号, name as 城市, sheng as 省份 from sys_shi where sheng='" & TempSheng & "'"Adodc2.Refresh然后我点击MSHFLEXGRID的时候就错位了,总是想后挪一行,我点第4行的时候,显示的是第三行的数据!!求教~~~~~~~
调试欢乐多
’——————————————————————————————————-
1。将代点击部他代码贴出来。
2。我怀凝你用的是DATAGRID。而非MSHFLEXGRID。
Private Sub MSHFlexGrid1_Click()
Dim n As Integer
On Error Resume Next
n = MSHFlexGrid1.Row
With Adodc1.Recordset
.MoveFirst
.Move (n - 1)
FieldsID = .Fields("编号")
Text1.Text = .Fields("省份")
TempSheng = Text1.Text
Adodc2.RecordSource = "select id as 编号, name as 城市, sheng as 省份 from sys_shi where sheng='" & TempSheng & "'"
Adodc2.Refresh
End With
MSHFlexGrid1.ColWidth(0) = 2500
End Sub
Private Sub MSHFlexGrid2_Click()
Dim n As Integer
MSHFlexGrid2.Refresh
On Error Resume Next
n = MSHFlexGrid2.Row
With Adodc2.Recordset
.MoveFirst
.Move (n - 1)
FieldsID = .Fields("编号")
Text2.Text = .Fields("城市")
End With
MSHFlexGrid2.ColWidth(0) = 2500
End Sub