Results 1 to 3 of 3

Thread: Question about Dbgid

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    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

  2. #2

    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


  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 1999
    Location
    Saudi Arabia, Gulf side, Qatif
    Posts
    142
    Thank you, it works excellent
    Appreciate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width