How to determine if current user is Admin (Access 97)

gregoryagu

Registered User.
Local time
Yesterday, 17:23
Joined
May 7, 2009
Messages
29
I have a form. When the form closes, I need to take action based on whether or not the user is a member of the Admin Group.

Is there a way to do programmatically determine the
group of the current user in Access 97?

Thanks,

Greg
 
OK, I have gotten this far. However, I get the following error: Object variable or With block variable not set.

Dim isAdmin As Boolean
isAdmin = False
Dim currentUser As user
Set currentUser = currentUser()

Dim currentGroups As groups
Set currentGroups = currentUser.groups
Dim aGroup As group

For Each aGroup In currentGroups
If aGroup.Name = "Admin" Then
isAdmin = True
End If
Next aGroup

Any advice would be appreciated. I have not been able to pin down the offending line.

Greg
 

Users who are viewing this thread

Back
Top Bottom