[AccessD] Can't Find Admins Group

Elam, Debbie DElam at jenkens.com
Sat Oct 14 18:34:34 CDT 2006


Perhaps "Admin" instead of "Admins"?  I did not check to see if this B
correct, but it was my first thought.

Debbie

-----Original Message-----
From: Dan Waters [mailto:dwaters at usinternet.com] 
Sent: Saturday, October 14, 2006 8:14 AM
To: 'Access Developers discussion and problem solving'
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
- JENKENS & GILCHRIST E-MAIL NOTICE - This transmission may be: (1) subject
to the Attorney-Client Privilege, (2) an attorney work product, or (3)
strictly confidential. If you are not the intended recipient of this
message, you may not disclose, print, copy or disseminate this information.
If you have received this in error, please reply and notify the sender
(only) and delete the message. Unauthorized interception of this e-mail is a
violation of federal criminal law. 
This communication does not reflect an intention by the sender or the
sender's client or principal to conduct a transaction or make any agreement
by electronic means.  Nothing contained in this message or in any attachment
shall satisfy the requirements for a writing, and nothing contained herein
shall constitute a contract or electronic signature under the Electronic
Signatures in Global and National Commerce Act, any version of the Uniform
Electronic Transactions Act or any other statute governing electronic
transactions.



More information about the AccessD mailing list