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
|
|||
|
|||
Visibility 2
Maybe I'm not expessing myself adequately. My form has many "Tabs". I want
to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#2
|
|||
|
|||
Visibility 2
I would suggest using a combo box for selecting the department (if you're
not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#3
|
|||
|
|||
Visibility 2
Beetle.... Works Almost perfectly. If I change the description in my
department drop down, the appropriate tab becomes visible. However, in the older records my department value is already established and the tabs do not change as I go from department to department.....(unless I change the value, and go back) Thoughts?? "Beetle" wrote: I would suggest using a combo box for selecting the department (if you're not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#4
|
|||
|
|||
Visibility 2
Put that same code to set the visibility into the form's Current event.
-- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Tom" wrote in message ... Beetle.... Works Almost perfectly. If I change the description in my department drop down, the appropriate tab becomes visible. However, in the older records my department value is already established and the tabs do not change as I go from department to department.....(unless I change the value, and go back) Thoughts?? "Beetle" wrote: I would suggest using a combo box for selecting the department (if you're not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#5
|
|||
|
|||
Visibility 2
Try duplicating the code in your form's Current event, then test
to make sure it works like you want. -- _________ Sean Bailey "Tom" wrote: Beetle.... Works Almost perfectly. If I change the description in my department drop down, the appropriate tab becomes visible. However, in the older records my department value is already established and the tabs do not change as I go from department to department.....(unless I change the value, and go back) Thoughts?? "Beetle" wrote: I would suggest using a combo box for selecting the department (if you're not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#6
|
|||
|
|||
Visibility 2
When I do, it tells me I can't hide a control that has the focus
"Douglas J. Steele" wrote: Put that same code to set the visibility into the form's Current event. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Tom" wrote in message ... Beetle.... Works Almost perfectly. If I change the description in my department drop down, the appropriate tab becomes visible. However, in the older records my department value is already established and the tabs do not change as I go from department to department.....(unless I change the value, and go back) Thoughts?? "Beetle" wrote: I would suggest using a combo box for selecting the department (if you're not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#7
|
|||
|
|||
Visibility 2
Set the focus back to the combo box before you hide the tabs;
Private Sub Form_Current Me.cboDepartment.SetFocus Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub -- _________ Sean Bailey "Tom" wrote: When I do, it tells me I can't hide a control that has the focus "Douglas J. Steele" wrote: Put that same code to set the visibility into the form's Current event. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Tom" wrote in message ... Beetle.... Works Almost perfectly. If I change the description in my department drop down, the appropriate tab becomes visible. However, in the older records my department value is already established and the tabs do not change as I go from department to department.....(unless I change the value, and go back) Thoughts?? "Beetle" wrote: I would suggest using a combo box for selecting the department (if you're not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
#8
|
|||
|
|||
Visibility 2
That did it...
Thnax Mucho "Beetle" wrote: Set the focus back to the combo box before you hide the tabs; Private Sub Form_Current Me.cboDepartment.SetFocus Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub -- _________ Sean Bailey "Tom" wrote: When I do, it tells me I can't hide a control that has the focus "Douglas J. Steele" wrote: Put that same code to set the visibility into the form's Current event. -- Doug Steele, Microsoft Access MVP http://I.Am/DougSteele (no private e-mails, please) "Tom" wrote in message ... Beetle.... Works Almost perfectly. If I change the description in my department drop down, the appropriate tab becomes visible. However, in the older records my department value is already established and the tabs do not change as I go from department to department.....(unless I change the value, and go back) Thoughts?? "Beetle" wrote: I would suggest using a combo box for selecting the department (if you're not doing that already), then you could code the After Update event of the combo box to show or hide tabs based on what is selected. For example, suppose you have a combo box named cboDepartment and a tab control named TabCtl0 with Engineering on the first tab and Science on the second tab. The code might look like; Private Sub cboDepartment_AfterUpdate Me.TabCtl0.Pages(0).Visible = Me.cboDepartment = "Engineering" Me.TabCtl0.Pages(1).Visible = Me.cboDepartment = "Science" End Sub The Page index is zero based, so the first tab is Page(0), the second is Page(1), etc. The reason I suggest a combo box is that if you use a text box and the user misspells something, you may end up with none of your tabs visible. -- _________ Sean Bailey "Tom" wrote: Maybe I'm not expessing myself adequately. My form has many "Tabs". I want to only have one "Visible" based on the information contained in a "Department" field on the main section of the form. Several different departments, each with a related tab for data. Example, Engineering in department field, only engineering tab shows.... |
Thread Tools | |
Display Modes | |
|
|