R
Ron
I have this Sub routine (see below) that's built into a
Form that basically looks up the value of a UserLevel in a
table which is based on the CurrentUser who's logged in at
that time. Then, certain controls on the form are hidden
based on the level of the user logged in.
My question is (and it's probably a simple answer): How
would I set up a second Lookup procedure inside that Sub
routine? The reason for the second one is that it needs
to reference another table to find a different set of
users and userlevels in order to hide other controls on
the form.
Thanks for the assistance on this.
Ron
-----------------------------------------------
Private Sub Form_Load() 'Current Sub
Dim sUserLevel As String
sUserLevel = DLookup
("pUserLevel", "[tblProjectMgrs]", "ProjectName=""" &
CurrentUser() & """")
If sUserLevel = 1 Then
Me.cmdOpenIBTform.Visible = False
Me.cmdOpenScriptTrackform.Visible = False
Me.IBtrackinglabel.Visible = False
Me.ScriptTrackinglabel.Visible = False
End If
End Sub
--------------------------------------
(This is the code for the 2nd Lookup but not sure how to
incorporate it into the Sub above.)
Dim rUserLevel As String
rUserLevel = DLookup
("tUserLevel", "[refTMSStrategyMgr]", "StrategyMgr=""" &
CurrentUser() & """")
If rUserLevel = 2 Then
Me.cmdOpenDMJIform.Visible = False
Me.DMJobTrackinglabel.Visible = False
End If
Form that basically looks up the value of a UserLevel in a
table which is based on the CurrentUser who's logged in at
that time. Then, certain controls on the form are hidden
based on the level of the user logged in.
My question is (and it's probably a simple answer): How
would I set up a second Lookup procedure inside that Sub
routine? The reason for the second one is that it needs
to reference another table to find a different set of
users and userlevels in order to hide other controls on
the form.
Thanks for the assistance on this.
Ron
-----------------------------------------------
Private Sub Form_Load() 'Current Sub
Dim sUserLevel As String
sUserLevel = DLookup
("pUserLevel", "[tblProjectMgrs]", "ProjectName=""" &
CurrentUser() & """")
If sUserLevel = 1 Then
Me.cmdOpenIBTform.Visible = False
Me.cmdOpenScriptTrackform.Visible = False
Me.IBtrackinglabel.Visible = False
Me.ScriptTrackinglabel.Visible = False
End If
End Sub
--------------------------------------
(This is the code for the 2nd Lookup but not sure how to
incorporate it into the Sub above.)
Dim rUserLevel As String
rUserLevel = DLookup
("tUserLevel", "[refTMSStrategyMgr]", "StrategyMgr=""" &
CurrentUser() & """")
If rUserLevel = 2 Then
Me.cmdOpenDMJIform.Visible = False
Me.DMJobTrackinglabel.Visible = False
End If