Switchboard - Hide Items

  • Thread starter Thread starter Craig Ferrier
  • Start date Start date
C

Craig Ferrier

Can I hide switchboard items based on users that Login as either an
Administrator or User.

I have a users table, login form and a module for users that sign in when
the database is opened. There are items on the switchboard that I dont want
to give Users access to.

How should i deal with this.

Craig
 
If you were using the built-in security features, you would do something
like this ...

Public Function IsUserInGroup(ByVal GroupName As String) As Boolean

Dim usr As User
Dim grps As Groups
Dim grp As Group

Set usr = CurrentUser()
Set grps = usr.Groups
For Each grp In grps
If grp.Name = GroupName Then
IsUserInGroup = True
Exit For
End If
Next grp

End Function

You could then use this function to set the Visible property of the controls
....

Me!SomeControl.Visible = IsUserInGroup("Admins")

Your description sounds as though you are using some kind of custom security
implementation, though, so you will likely need to adapt the above to work
with your implementation.
 
Back
Top