Function will only work with 1 member of Admins group

G

Gwen

Hi,
Once again, Please help

The below function (courtesy of someone in the message
board)will only work with one member of the Admins group.

This how I am calling the function
If fncUserIsInGroup("Admins") = True Then
DoCmd.OpenQuery ("qmakTest")
end if

Function fncUserIsInGroup(GroupName As String) As Boolean
'Returns True if the current user is a member of the
specified ' security group.
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
'Debug.Print GroupName
'Debug.Print CurrentUser
On Error Resume Next
fncUserIsInGroup = (ws.Users(CurrentUser).Groups
(GroupName).name = GroupName)
'Debug.Print GroupName
Set ws = Nothing
End Function

Obviously, I missing something.

Thanks

Gwen
 

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

Top