[AccessD] SOLVED - Can't Find Admins Group

Dan Waters dwaters at usinternet.com
Sat Oct 14 09:40:08 CDT 2006


I was opening an instance of Access and not closing it prior to running the
function below.  :-(

Dan Waters

I like this list.  Whenever I send a question, I think of the answer!  ;-)

-----Original Message-----
Subject: [AccessD] Can't Find Admins Group

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

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list