Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hiding Tabs (Access 2003)

    Hi, does anyone know if it is possible to hide tabs in a form if they are not needed for that type? eg. we have a form where three different types of information come into together and have one tab which shows the main information. We then have three extra tabs, one for each type. We would like to be able to only show the two tabs that are needed for each type, without creating seperate forms for each, is this possible?? Thanks
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Hiding Tabs (Access 2003)

    You can hide/unhide tab pages in code:

    Me.TabControl.Pages(2).Visible = False

    will hide the 3rd tab page (they are numbered starting with 0, so Pages(2) is the 3rd tab)

  3. #3
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    Thanks, where do i put this code??
    Thanks
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Hiding Tabs (Access 2003)

    Probably in the On Current event of the form, but you'll have to provide more info if you want specific help.

  5. #5
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    Hi, i havent got an "on Current" event, what information would you need for further help?
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Hiding Tabs (Access 2003)

    How can we decide which tabs should be displayed, and when do you want this to happen? Please try to provide detailed and specific information.

  7. #7
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    i want the 1st & 2nd tab to be there but the 3rd & 4th not to be when i open the form if it is type 1;
    i want the 1st & 3rd tab to be there but the 2nd & 4th not to be when i open the form if it is type 2;
    i want the 1st & 4th tab to be there but the 2nd & 3rd not to be when i open the form if it is type 3;
    I would like this to happen as i open the form? Do you need to know what the types are/what the tabs are called? Thanks
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Hiding Tabs (Access 2003)

    > "... if it is type 1"

    How do I know if it is type 1, 2 or 3?

  9. #9
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    the field called "TRType" will be either type one type two or type three.

    Does that help?
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Hiding Tabs (Access 2003)

    And shouldn't the visibility change as the user moves from record to record? Or is it impossible to move to another record?

  11. #11
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    yes we would like the visibility to change as that field changes between records if possible.

    Thanks
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

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

    Re: Hiding Tabs (Access 2003)

    Proceed as follows:
    <UL><LI>Open the form in design view.
    <LI>Activate the Event tab of the Properties window.
    <LI>Click in the On Current event (it's the first one).
    <LI>Select [Event Procedure] from the dropdown list.
    <LI>Click the ... button to the right of the dropdown arrow.
    <LI>The Visual Basic Editor will be activated, and you'll see the following code:
    <code>
    Private Sub Form_Current()

    End Sub
    </code>
    <LI>Make the code look like this:
    <code>
    Private Sub Form_Current()
    Dim i As Integer
    For i = 1 To 3
    Me.TabControl.Pages(i).Visible = (Me.TRType = i)
    Next i
    End Sub
    </code>
    Substitute the name of the tab control for TabControl. If the name contains spaces or punctuation, put square brackets around it, e.g.
    <code>
    Me.[Tab Control].Pages(i).Visible = (Me.TRType = i)
    </code>
    <LI>Switch back to Access.
    <LI>Close and save the form.[/list]Now open the form to test if the code works.

  13. #13
    Star Lounger
    Join Date
    Nov 2005
    Location
    Edmonton, Alberta, Canada
    Posts
    66
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    In addition to what HansV suggested, if your TRType field is on the tabbed form (presumably on one of the pages that is always visible), you'll probably want to put the same code in the After Update event of the TRType field so when the type is entered the appropriate pages immediately disappear.

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

    Re: Hiding Tabs (Access 2003)

    Good point! <img src=/S/thumbup.gif border=0 alt=thumbup width=15 height=15>

  15. #15
    4 Star Lounger
    Join Date
    Feb 2001
    Location
    BECCLES, Suffolk, England
    Posts
    407
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Hiding Tabs (Access 2003)

    Thank-you for the code, I can't get it to work unfortunately, there is propably something I am missing, i am substituting the TabControl for the name of the Tab - ReturnTab do I have to substitute anything else? I dont know whether I am supposed to change the i??
    <IMG SRC=http://www.wopr.com/w3tuserpics/StephenElms_sig.jpg> Didn't think that I made my first post here on 5th February 2001...!

Page 1 of 2 12 LastLast

Posting Permissions

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