i need help with tabbed forms (1 Viewer)

dutchpete

New member
Local time
Today, 19:28
Joined
Jun 12, 2001
Messages
7
Hello,
can someone help me with the folowing problem,
on a form i have a combobox and behind this combobox is a query from a table with postal codes.
on the form are also 8 tabs and on every tab there is a subform relating to a table with the produktion of one of our employees.
these employees work in a postal region.
what i want is this:
i want to select (or search) a postal code form the combobox and then open only the related tab from the employee. all other tabs should be hidden.
i already tried several macro's in wich i try to hide the subforms but i cant make one of them visible.
thanks very much.
peter
 

AlanS

Registered User.
Local time
Today, 14:28
Joined
Mar 23, 2001
Messages
292
In the AfterUpdate event procedure for the combo box, set the Visible property for each tab, based on the updated value of the combo box. For example:

Private Sub Combo1_AfterUpdate
Tab1.Visible = Combo1 = 1
Tab2.Visible = Combo1 = 2
...
Tab8.Visible = Combo1 = 8
End Sub

Assuming that you're tracking the same information for each employee, it might be easier to just do away with the tabs, and replace them all with a single form. The form would display records from the table or query with your employee data. The particular record from the table or query would be selected and display based on the value of the combo box. If you have your control wizards turned on in Form Design view, when you create a combo box one of the options is to do exactly that.
 

Users who are viewing this thread

Top Bottom