Andrew said:
In VBA how do I determine the CurrentUser's Group they are assigned to in
the
Access WorkGroup file?
A user may be in more than one group. You can, potentially, construct a
list of all the groups to which the current user belongs, or you can find
out whether a user belongs to a particular group in which you are
interested. When I have been concerned with this, my need was to know
whether the user was in the Admins group.
Here's a function you can call to find out if the current user is in a given
group:
'------ start of code ------
Function fncUserIsInGroup(GroupName As String) As Boolean
' Returns True if the current user is a member of the specified
' security group; False if not, or if the group doesn't exist, or
' if an error occurs reading the groups.
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
On Error Resume Next
fncUserIsInGroup = _
(ws.Users(CurrentUser).Groups(GroupName).Name = GroupName)
Set ws = Nothing
End Function
'------ end of code ------