-
I am using a Dbgrid as viewer for my data base records, I allow the user to add new records via the Dbgrid with allow add new record properties, when the user entered the data in one cell I would like him to hit the tab and move the cursor to the next cell when finished, what is happening when tab pressed the text in the cell will be highlighted then the user has to press the tab again to move which is a little bit a headach, any help on this will be appreciated
Regards
-
This will work
Private Sub DBGrid1_KeyDown(KeyCode As Integer, Shift As Integer)
On Error GoTo errhandler
If KeyCode = vbKeyTab Then
DBGrid1.Col = DBGrid1.Col + 1
End If
Exit Sub
errhandler:
End Sub
__________________________________
This will work, but make sure to include the error handler to capture the error when you get to the last column and try to move to the next. You don't need any code to handle the error it works fine as above.
Bob
-
Thank you, it works excellent
Appreciate