Enable a button based on logon User Group

  • Thread starter Thread starter PadmaBhaskar
  • Start date Start date
P

PadmaBhaskar

Hi,

I have a menu screen with a few option buttons. The application has
multiple users (say, user1, admin1) belonging to multiple groups (like
AppAdmins, AppUsers)

The button needs to be enabled if the logon user belongs to AppAdmins
group and disabled otherwise.

Is there a way to implement this?

Thanks in advance!
 
There is a function in the security FAQ you can use to determine if a user
is a member of a particular group.
http://support.microsoft.com/?id=207793

If faq_IsUserInGroup("AppAdmins",CurrentUser) then
Me.cmdWhatever.Visible = True
Else
Me.cmdWhatever.Visible = False
End If

You could use the Enabled property instead of Visible, but Visible is more
user-friendly.
 
Back
Top