Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Tab Index (A2003)

    I have a tabbed form with 15 tabs. The visibile property to all but the first tab is NO. I have a NEXT and PREVIOUS button on the form footer. I want to be able to write code that will determine what TAB INDEX (TI) the user is CURRENTLY on, then;

    If they are on tab index 2 and hit the NEXT button the code will set the visible property of TI 3 to YES and send the user to TI 3, if on 5, set visible YES on TI 6 and send user to TI 6 and so on.

    I just can't seem to find a method to determine the TI. Does anyone have a suggestion?

    Thanks in advance.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

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

    Re: Tab Index (A2003)

    The Value property of the tab control is the index of the active tab, starting at 0, i.e. if the first tab is active, Value = 0, if the second tab is active, Value = 1 etc.

    So you should be able to use code like this, where cmdNext is the name of the "Next" command button, and tabPages is the name of the tab control:

    Private Sub cmdNext_Click()
    Dim intIndex As Integer
    intIndex = Me.tabPages.Value
    ' Check that we're not on the last tab
    If intIndex < Me.tabPages.Pages.Count - 1 Then
    ' Make next page visible
    Me.tabPages.Pages(intIndex + 1).Visible = True
    ' And activate it
    Me.tabPages.Value = intIndex + 1
    End If
    End Sub

  3. #3
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Louisville, Kentucky, USA
    Posts
    605
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Tab Index (A2003)

    HANS....YOU ARE MY HERO.....thank you.
    Roberta Price <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>

Posting Permissions

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