Results 1 to 4 of 4
  1. #1
    tandridge is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2011
    Posts
    2

    Option Control to hide/show page tabs

    Hello all!



    I am fairly new to access databases and am teaching myself as I go along. However I have now got myself stuck!

    I am creating a form where I have an option group with 7 options and a tab control with 7 pages. What I want to happen is when a user selects an option only the corresponding page tab is displayed, all the others are hidden. I would also want all the tabs hidden when opening a new record and no selection has yet been made.

    Is this possible and can anyone point me in the right direction?

    Thanks for your time

  2. #2
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    Make all pages of a tab control invisible:

    dim pge as page
    For Each pge In MyTabControl.Pages
    pge.Visible = False
    Next pge

    Make a tab control page visible

    MyTabControl.Pages("My Page Name").Visible = True

  3. #3
    tandridge is offline Novice
    Windows XP Access 2002
    Join Date
    Dec 2011
    Posts
    2
    Hi Peter,

    Thanks for your help. I have had a go but am not sure where I should be putting first part of the code.

    I also assumed where I should change the code to refer to the names of my tab control and pages, on the on click event procedure for my option control is

    Private Sub Option285_Click()
    TabCtl52.Pages("Page1").Visible = True
    End Sub

    Is that correct?

  4. #4
    pdebaets is offline Competent Performer
    Windows Vista Access 2010 (version 14.0)
    Join Date
    Jul 2010
    Location
    Los Angeles
    Posts
    235
    I imagine that you'll want to hide all the pages before making the one you want visible made visible.

    This code may work for you:

    Private Sub Option285_Click()
    '* Make all pages invisible
    dim pge as page
    For Each pge In TabCtl52.Pages
    pge.Visible = False
    Next pge
    set pge = nothing

    '* Make one page visible
    TabCtl52.Pages("Page1").Visible = True
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 11
    Last Post: 09-16-2011, 11:47 AM
  2. Show/Hide Form
    By sparlaman in forum Forms
    Replies: 5
    Last Post: 05-16-2011, 11:48 AM
  3. Show page on tab from control on subform
    By jpkeller55 in forum Access
    Replies: 1
    Last Post: 01-24-2011, 07:55 AM
  4. Hide and show tekstbox
    By Patience in forum Access
    Replies: 3
    Last Post: 06-18-2010, 06:15 AM
  5. Show Hide Subreport / acViewReport
    By BigBear in forum Reports
    Replies: 4
    Last Post: 03-30-2009, 06:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums