I copied this here just in case you didn't see it in your other post.
One good method would be to make a form which you open and hide using the autoexec macro. This form should have a textbox where you will store the department name when the user logs in. Then in the forms for each interface use this code in the open event:
If Forms!YourForm!YourTextBox = "Staff" Or etc. Then
Cancel = -1
End If
Alternatively
Select Case Forms!YourForm!YourTextBox
Case "Staff", "etc."
Cancel = -1
End Select
This code will not allow the departments in your condition statement to open the form. Of course, you could be even more specific by allowing some to open the interface as read only or to lock certain textboxes. It can give you a lot of leeway.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.