Private Sub Datagrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
Dim i As Integer
'Dim aa As String
For i = 0 To datagrid1.Columns.Count - 1
datagrid1.Col = i '应是datagrid1
'aa = aa & " " & datagrid1.Text '同理换成用text显示就行了
If datagrid1.Columns(i).DataField = "zd1" Then
text1.Text = datagrid1.Text '这样即可显示在text1
ElseIf datagrid1.Columns(i).DataField = "zd2" Then
text2.Text = datagrid1.Text '这样即可显示在text2
End If
Next
'MsgBox aa
End Sub
Private Sub Datagrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
Dim i As Integer
Dim aa As String
For i = 0 To Datagrid1.Columns.Count - 1
Dg_hx.Col = i
aa = aa & " " & Datagrid1.Text '同理换成用text显示就行了
Next
MsgBox aa
End Sub