Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jan 2001
    Location
    Indiana
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tab Control (97/2000/2002)

    I have a form with a Tab Control. What I would like is as the user enters information throughout the form then clicks the New Record button the Tab Control goes back to the first Tab. I know this may have to be accomplished in code and would appreciate anyones help.

    Thanks
    Tom

  2. #2
    New Lounger
    Join Date
    Dec 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Control (97/2000/2002)

    Just need three lines of code:

    Private Sub cmdNewRecord_Click()
    Me.TabCtl0.Pages(0).SetFocus
    End Sub


    Bob

  3. #3
    Silver Lounger
    Join Date
    Jun 2002
    Location
    Cheadle, Staffordshire
    Posts
    2,177
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Control (97/2000/2002)

    You've probably got a subform on each tab control, here's how I set mine up.

    Private Sub Command0_Click()
    Forms!frmMainFormName!sbfSubFormName.SetFocus
    Forms!frmMainFormName!sbfSubFormName!txtFieldName. SetFocus
    DoCmd.GoToRecord , , acNewRec
    End Sub

    Change frmMainFormName to The FormContaining the tabs.
    Change sbfSubFormName to The Form Within the tab.
    Change txtFieldName to the field you want to focus.

    Hope this helps

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Tab Control (97/2000/2002)

    You should be able to set the value of the tab control to 0, which is the index value of the first page.
    Charlotte

Posting Permissions

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