A user can be a member of more than one group, and frequently will be, as
all users are members of the built-in Users group. So whenever someone asks
about displaying the name of the user's group, we have to ask: 'Which one?'
Here's a function that will display a list of all groups of which the user
is a member ...
Public Function ListGroups(ByVal UserName As String) As String
Dim usr As User
Dim grp As Group
Dim strResult As String
Set usr = DBEngine.Workspaces(0).Users(UserName)
For Each grp In usr.Groups
strResult = strResult & grp.Name & vbNullChar
Next grp
ListGroups = strResult
End Function
Here's an example of it's use, in the Immediate Window ...
? listgroups(currentuser())
Admins Users
For a function to determine whether a user is in a specified group, see the
following discussion in the Google newsgroup archives ...
http://groups.google.com/group/microsoft.public.access/browse_frm/thread/e8058ff8a64bc21e