Enabling controls based on user group

  • Thread starter Thread starter RipperT
  • Start date Start date
R

RipperT

I am trying to figure out how I can check if the CurrentUser is a member of
a specific group and enable/disable a button based upon it. Can anyone get
me started? What I've tried appears to be far from what I need.

Thx,

Rip
 
A user can be members of multiple groups, so you cannot start with the user
and discover what their group is. You must start with the group, and see if
the user is a member.

The code to do that looks like this:

Function IsUserInGroup(strUser As String, strGroup As String) As Boolean
Dim varDummy As Variant
On Error Resume Next
varDummy = DBEngine(0).Users(strUser).Groups(strGroup).Name
IsUserInGroup = (Err.Number = 0)
End Function
 

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

Back
Top