Switchboard - Hide Items

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
 
B

Brendan Reynolds

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top