Enable Function to list system users

C

Casey

Hi,

I have the function below that I got from a Microsoft
FAQ information page (I changed the title a little bit).
It is supposed to list all of the users for the present
workgroup file for a current database. I placed it in a
module, and called it as the onclick of a button from a
form in a macro, using the RunCode action, but nothing
seems to happen. Does anyone have any comments on what
may be the way to enable it properly if I am not.

Function inf_ListUsersInSystem()
Dim ws As Workspace
Dim i As Integer

Set ws = DBEngine.Workspaces(0)
For i = 0 To ws.Users.Count - 1
Debug.Print ws.Users(i).Name
Next i
End Function

Thanks,

Casey
 
Top