Private Sub Command1_Click()
myrst.Move 3
DataGrid1.Columns(1).Text = "asas"
End Sub
Private Sub DataGrid1_RowColChange(LastRow As Variant, ByVal LastCol As Integer)
DataGrid1.SelStart = Len(DataGrid1.Text)
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 0 To 2 '为Recordset三个字段,即为 DataGrid 添加三列
myrst.Fields.Append "第" & i & "列", adVariant, , adFldMayBeNull + adFldIsNullable + adFldUpdatable
Next i
myrst.Open
For i = 0 To 3
myrst.AddNew '加四条记录,即为 DataGrid 添加四空行
Next i
Set DataGrid1.DataSource = myrst '绑定 DataGrid 的数据源
myrst.MoveFirst
End Sub