mystery issue with users groups

teel73

Registered User.
Local time
Today, 10:31
Joined
Jun 26, 2007
Messages
205
I am using code to list the groups a specific user belongs to with the following code:

Code:
Set wrkDefault = DBEngine.Workspaces(0)

usrNam = "tanya"
Set usr = wrkDefault.Users(usrNam)

For Each grp In usr.Groups
    Debug.Print grp.Name

Next grp

That code works fine the first time. But when I manually REMOVE a group using the "User and Group Accounts" .. then run my code to list the groups, the same groups are listed as if it didn't recognize that I removed a group. What could be the problem. I don't understand.
 
Have you closed and restarted the database before checking again? It is something that needs to be refreshed by doing that.
 
yes. it works when I close out of the database and then go back in. That's exactly the problem .. I need for it to refresh without having to close it. How do I do that?
 
yes. it works when I close out of the database and then go back in. That's exactly the problem .. I need for it to refresh without having to close it. How do I do that?

I don't think you can. It is one of those things that loads up first when Access starts.
 
Hey .. i figured it out. collection.refresh ... thanks for the suggestion!
 
Well, cool - glad you figured it out and I learned something new in the process :D
 

Users who are viewing this thread

Back
Top Bottom