Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Jun 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Set Focus in Tabbed Pages (Access 2002)

    I'm probably missing something easy but wonder if someone can enlighten me cos it's driving me mad!!

    I am working with tabbed pages in an Access Database.

    The key data is on the top part of the form, then the tabs and below that the data relevant to that particular tab. When I click the various tabs the focus goes to the first field in the tab, however I would prefer it the initial focus to go to the first item at the top part of the form, even if I set the focus on the On Click for the tab to be the field I want it doesn't work. I'm sure it's just something simple that I'm missing but I can't work it out.

    Hope someone can help.

    Many thanks

    <img src=/S/dizzy.gif border=0 alt=dizzy width=15 height=15>

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

    Re: Set Focus in Tabbed Pages (Access 2002)

    The standard behavior of a tab control is what most users would expect - clicking on a tab activates the tab page, i.e. sets focus to the first control in the tab order of that tab page.

    But if you want to change it, you must use the On Change event of the tab control; the On Click events of the tab pages and of the tab control are useless. Say that your tab control is named tabPages and that you want to set focus to a text box txtKey in the top part of the form. Create the following code in the On Change event of tabPages:

    Private Sub tabPages_Change()
    Me.txtKey.SetFocus
    End Sub

  3. #3
    Star Lounger
    Join Date
    Jun 2003
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Set Focus in Tabbed Pages (Access 2002)

    That's brilliant thank you.

Posting Permissions

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