Sub CheckUser()
' Display the user name and the groups the user belongs to
Dim ws As DAO.Workspace
Dim db As DAO.Database
Set ws = DBEngine.Workspaces(0)
Set db = CurrentDb
Debug.Print ws.Groups.Count & " Groups "
Dim X As Integer
Dim Y As Integer
For X = 0 To ws.Groups.Count - 1
For Y = 0 To ws.Users.Count - 1
If ws.Users(Y).Name = CurrentUser() Then
Debug.Print " - " & ws.Users(Y).Name & "." &
ws.Groups(X).Name
End If
Next Y
Next X
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.