jonathanchye
Registered User.
- Local time
- Today, 22:00
- Joined
- Mar 8, 2011
- Messages
- 448
In my table I have a column called "Departments" which is set in Access 2010 to be a multiple value field.
This works brilliantly on user input level as a smart drop down box which contains check boxes which allows users to select one or more values.
However, the problem comes when I need to check the values selected. Normally I would use Dlookup and assign this value to a variable. However, how should I do it in this case as the column might contain more than 1 values?
In one of my forms, I need to do this action in the On Load event :
DLookup("Departments", "tblManagers")
I need to use the result(s) from this DLookup to set the visibility of some controls in my forms. Can I use something like this in my form's On Load event?
Basically I want to only make relevant tabs visible. So if a person has Departments assigned as Finance and Maintanent both will be visible but not Manangement etc.
This works brilliantly on user input level as a smart drop down box which contains check boxes which allows users to select one or more values.
However, the problem comes when I need to check the values selected. Normally I would use Dlookup and assign this value to a variable. However, how should I do it in this case as the column might contain more than 1 values?
In one of my forms, I need to do this action in the On Load event :
DLookup("Departments", "tblManagers")
I need to use the result(s) from this DLookup to set the visibility of some controls in my forms. Can I use something like this in my form's On Load event?
Code:
Me.tab1.Visible = False
Me.tab2.Visible = False
Me.tab3.Visible = False
Dim temp As Variable
temp = DLookup("Departments", "tblManagers")
If temp = "Finance" Then
Me.tab1.Visible = True
End If
If temp = "Maintanence" Then
Me.tab2.Visible = True
End If
If temp = "Management" Then
Me.tab3.Visible = True
End If
Basically I want to only make relevant tabs visible. So if a person has Departments assigned as Finance and Maintanent both will be visible but not Manangement etc.