Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command button visible using DLookup 1

Status
Not open for further replies.

meagain

MIS
Nov 27, 2001
112
CA
Hi All,

I need to make a command button visible to certain users based on a multiple user levels in a table.

I currently am using the following code successfully to make the button visible to one user level:

If DLookup("Level", "USERS", "[USER ID] = '" & CurrentUser & "'") = 9 Then
Me.Command180.Visible = True
Else

Me.Command180.Visible = False
End If


How can I amend this so levels 2,15, and 32 can also see the button?

Thank you!!
 
You may try this:
Code:
Dim lngLevel As Long
lngLevel = DLookup("Level", "USERS", "[USER ID] = '" & CurrentUser & "'")
Me!Command180.Visible = (lngLevel = 2 Or lngLevel = 9 Or lngLevel = 15 Or lngLevel = 32)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top