If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Hiding/Unhiding Tabs
I am using Access 2003.
I have an unbound form that I am using as a customized menu for my database and have multiple tabs which I have set as visible=no. I have an unbound combo box on my home tab that asks the user to select the type of project they are working on and would like the appropriate hidden tab to appear once a user makes their choice. If they Choose "Private" then one tab will appear, if they choose "DASNY" then another tab will appear. The problem I have is that either the tabs do not hide after a change is made OR (with the code below) only the first "ProjectType" works properly. In this case, "Private" will switch between hidden and unhidden but none of the other tabs work. Private Sub ProjectType_Change() If Me.ProjectType = "Private" Then Me.Accounting.Visible = True ElseIf Me.ProjectType "Private" Then Me.Accounting.Visible = False ElseIf Me.ProjectType = "DASNY" Then Me.DASNY.Visible = True ElseIf Me.ProjectType "DASNY" Then Me.DASNY.Visible = False ElseIf Me.ProjectType = "DDC/EDC" Then Me.DASNY.Visible = True ElseIf Me.ProjectType "DDC/EDC" Then Me.DASNY.Visible = False End If End Sub Is there a way to enter multiple options so that when a user switches from one job type to another the appropriate tab will appear and the unneeded one will be hidden again? |
#2
|
|||
|
|||
Hiding/Unhiding Tabs
Lori -
Try this: Private Sub ProjectType_Change() If Me.ProjectType = "Private" Then Me.Accounting.Visible = True Else Me.Accounting.Visible = False End If If Me.ProjectType = "DASNY" Then Me.DASNY.Visible = True Else Me.DASNY.Visible = False End If If Me.ProjectType = "DDC/EDC" Then Me.DASNY.Visible = True Else Me.DASNY.Visible = False End If End Sub -- Daryl S "Lori" wrote: I am using Access 2003. I have an unbound form that I am using as a customized menu for my database and have multiple tabs which I have set as visible=no. I have an unbound combo box on my home tab that asks the user to select the type of project they are working on and would like the appropriate hidden tab to appear once a user makes their choice. If they Choose "Private" then one tab will appear, if they choose "DASNY" then another tab will appear. The problem I have is that either the tabs do not hide after a change is made OR (with the code below) only the first "ProjectType" works properly. In this case, "Private" will switch between hidden and unhidden but none of the other tabs work. Private Sub ProjectType_Change() If Me.ProjectType = "Private" Then Me.Accounting.Visible = True ElseIf Me.ProjectType "Private" Then Me.Accounting.Visible = False ElseIf Me.ProjectType = "DASNY" Then Me.DASNY.Visible = True ElseIf Me.ProjectType "DASNY" Then Me.DASNY.Visible = False ElseIf Me.ProjectType = "DDC/EDC" Then Me.DASNY.Visible = True ElseIf Me.ProjectType "DDC/EDC" Then Me.DASNY.Visible = False End If End Sub Is there a way to enter multiple options so that when a user switches from one job type to another the appropriate tab will appear and the unneeded one will be hidden again? |
#3
|
|||
|
|||
Hiding/Unhiding Tabs
you are wonderful. THANKS
"Daryl S" wrote: Lori - Try this: Private Sub ProjectType_Change() If Me.ProjectType = "Private" Then Me.Accounting.Visible = True Else Me.Accounting.Visible = False End If If Me.ProjectType = "DASNY" Then Me.DASNY.Visible = True Else Me.DASNY.Visible = False End If If Me.ProjectType = "DDC/EDC" Then Me.DASNY.Visible = True Else Me.DASNY.Visible = False End If End Sub -- Daryl S "Lori" wrote: I am using Access 2003. I have an unbound form that I am using as a customized menu for my database and have multiple tabs which I have set as visible=no. I have an unbound combo box on my home tab that asks the user to select the type of project they are working on and would like the appropriate hidden tab to appear once a user makes their choice. If they Choose "Private" then one tab will appear, if they choose "DASNY" then another tab will appear. The problem I have is that either the tabs do not hide after a change is made OR (with the code below) only the first "ProjectType" works properly. In this case, "Private" will switch between hidden and unhidden but none of the other tabs work. Private Sub ProjectType_Change() If Me.ProjectType = "Private" Then Me.Accounting.Visible = True ElseIf Me.ProjectType "Private" Then Me.Accounting.Visible = False ElseIf Me.ProjectType = "DASNY" Then Me.DASNY.Visible = True ElseIf Me.ProjectType "DASNY" Then Me.DASNY.Visible = False ElseIf Me.ProjectType = "DDC/EDC" Then Me.DASNY.Visible = True ElseIf Me.ProjectType "DDC/EDC" Then Me.DASNY.Visible = False End If End Sub Is there a way to enter multiple options so that when a user switches from one job type to another the appropriate tab will appear and the unneeded one will be hidden again? |
Thread Tools | |
Display Modes | |
|
|