城堡争霸绿毛叫什么:vb中datagrit_click的问题

来源:百度文库 编辑:中科新闻网 时间:2024/04/29 07:10:07
如何使单击事件只可以单击个别字段 而不是全部字段
例Private Sub DataGrid1_Click()
Adodc1.Recordset.Update
Adodc1.Refresh
DataGrid1.Refresh

Text3.Text = Adodc1.Recordset.Fields("户主").Value
Text4.Text = Adodc1.Recordset.Fields("表编号").Value
这样我点编号时 它会到户主的字段 如何解决 请教

你可以在 RowColChange 事件里让它的Col值始终等于你想要单击的列,如:
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
DataGrid1.Col = 0
End Sub