G
Guest
I writing my code that will enable/disable controls based on the user groups.
What I am finding is that when I set my code for one particular groups it
affects the other groups. So my question is, will I have to use the If
faq_IsUserInGroup statement for all of my groups?
For example,
I have 7 controls on my form.
I have the Admin, Manufacturing, and Regulatory group.
I have set my coding as follows:
If faq_IsUserInGroup("Admins", CurrentUser) Then
Me.Add_Review_Employee_Information.Visible .... (For the admin group, my
intention is to make all the controls visibile - Am I going in the right
direction?)
If faq_IsUserInGroup("Regulatory", CurrentUser) Then
Me.Add_Review_Employee_Information.Visible = True
Me.cmdViewTraining.Visible = True
Me.cmdReviseSops.Visible = True
Me.cmdAddBpr.Visible = True
Me.cmdRunReports.Visible = True
Me.cmdAddLotNumber.Visible = True
Me.cmdExit.Visible = True
Else
Me.cmdAddLotNumber.Visible = False
End If
If faq_IsUserInGroup("Manufacturing", CurrentUser) Then
Me.cmdRunReports.Visible = True
Me.cmdAddLotNumber.Visible = True
Me.cmdExit = True
Else
Me.Add_Review_Employee_Information.Visible = False
Me.cmdAddBpr.Visible = False
Me.cmdReviseSops.Visible = False
Me.cmdViewTraining.Visible = False
End If
End Sub
What I am finding is that when I set my code for one particular groups it
affects the other groups. So my question is, will I have to use the If
faq_IsUserInGroup statement for all of my groups?
For example,
I have 7 controls on my form.
I have the Admin, Manufacturing, and Regulatory group.
I have set my coding as follows:
If faq_IsUserInGroup("Admins", CurrentUser) Then
Me.Add_Review_Employee_Information.Visible .... (For the admin group, my
intention is to make all the controls visibile - Am I going in the right
direction?)
If faq_IsUserInGroup("Regulatory", CurrentUser) Then
Me.Add_Review_Employee_Information.Visible = True
Me.cmdViewTraining.Visible = True
Me.cmdReviseSops.Visible = True
Me.cmdAddBpr.Visible = True
Me.cmdRunReports.Visible = True
Me.cmdAddLotNumber.Visible = True
Me.cmdExit.Visible = True
Else
Me.cmdAddLotNumber.Visible = False
End If
If faq_IsUserInGroup("Manufacturing", CurrentUser) Then
Me.cmdRunReports.Visible = True
Me.cmdAddLotNumber.Visible = True
Me.cmdExit = True
Else
Me.Add_Review_Employee_Information.Visible = False
Me.cmdAddBpr.Visible = False
Me.cmdReviseSops.Visible = False
Me.cmdViewTraining.Visible = False
End If
End Sub