我是这样做的:
On Error Resume Next
'使回车键也能移动当前格
If KeyCode = vbKeyReturn Then
KeyCode = vbKeyTab
' grdDataGrid.Row = grdDataGrid.Row + 1
End If
'右键
If KeyCode = vbKeyRight Then
KeyCode = vbKeyTab
End If
'左、上、下键
If KeyCode = vbKeyLeft Or KeyCode = vbKeyUp Or KeyCode = vbKeyDown Then
With grdDataGrid
.Text = .Text
.SelStart = 0
.SelLength = 100
End With
Me.datPrimaryRS.Recordset.UpdateBatch
End If