In a datagrid, I am using arrow keys, tab, and return to advance to the next or previous record, depending on the conditions.
e.g. in the keypress event
and I have similar code for the arrow keys and enter. The problem is that if the user is on the last visible record, the grid will advance but the column value will be 0, as in the cursor will not automatically go to Column 2.Code:If KeyAscii = vbKeyTab and DataGrid1.Col = 6 Then 'advance to next record DataGrid1.Row = DataGrid1.Row + 1 DataGrid1.Col = 2 Exit Sub End If
Please help, I need it!
Andrew




Reply With Quote