[AccessD] Can't Find Admins Group

Dan Waters dwaters at usinternet.com
Sat Oct 14 08:13:42 CDT 2006


Hello to All!

I'm having trouble with this function.  It errors out on line 10, telling me
'Item not found in this collection'.  It can find the Admins group???  It's
as if the workspace is wrong or doesn't exist somehow.


    Dim wrk As DAO.Workspace
    Dim grp As DAO.Group
    Dim usr As DAO.User
    Dim varUserName As Variant

    Set wrk = DBEngine.Workspaces(0)
    wrk.Users.Refresh
    wrk.Groups.Refresh
10  Set grp = wrk.Groups("Admins")

    AdminGroupMember = False
    For Each usr In grp.Users
        If CurrentUser = usr.Name Then
            AdminGroupMember = True
            Exit For
        End If
    Next usr

    Exit Function


Thanks for any and all help!
Dan Waters




More information about the AccessD mailing list