Results 1 to 2 of 2

Thread: Tab Order (XP)

  1. #1
    Lounger
    Join Date
    Jan 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tab Order (XP)

    I have a multi-page form that is separated into tabs, but can't get the form to tab from the last field on one page to the first field on the next page. Instead it goes to the first field on the next record. Is it possible to tab to the next page of the same record than to the first page of the next record without an event procedure? Thanks.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Tab Order (XP)

    1. A simplistic solution: use code in the On Exit event of the last control on the tab page:

    Private Sub ControlName_Exit(Cancel As Integer)
    Me.TabControl = Me.TabControl + 1
    End Sub

    Substitute the appropriate control names. Disadvantage is that you will be taken to the next tab page if you click in another control on the same tab page.

    2. Slightly more sophisticated: use code in the On Key Down event and test if the user pressed Tab or Enter:

    Private Sub ControlName_Keydown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 9 Or KeyCode = 13 Then
    Me.TabControl = Me.TabControl + 1
    KeyCode = 0
    End If
    End Sub

Posting Permissions

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