Scott, thanks again for responding.
I would like the user to click a button that would produce the same report
and have the same action as when you would select the following:
Tools
Security
User and Group Accounts
Print Users and Groups command button on the Users tab
Only Users option
Ok command button
Is this possible?
You can use the various File I/O commands to print something like this, or you could dump this info to a table and build
a report on that table.
A better method might be to simply allow the user to use the builtin commands. You can build a custom toolbar/menubar
that allows them to view this toolbar (or portion of toolbar) so they can print this report. Assuming you've setup
security properly, they wouldn't be able to manipulate any settings.
To use standard File I/O, do something like this:
Function faq_ListUsersInSystem ()
Dim ws As DAO.WorkSpace
Dim usr As DAO.User
Dim i As Integer
Dim j as Integer
Dim strUser As STring
Dim lngFile As Long
'/open your text file
lngFile = FreeFileHandle
Open "Full path" For Output As #lngFile
Print #lngfile, Now
Print #lngFile, "--------------------------------------------------"
Print #lngFile, ""
Print #lngFile, "Users"
Print #lngFile, ""
Set ws = DBEngine.Workspaces(0)
For i = 0 To ws.Users.count - 1
Set usr = ws.Users(i)
strUsers = ws.Users(i).Name & vbTab
For j = 0 to usr.Groups.Count -1
'/now get a list of the Groups
strUsers = strUsers & usr.Groups(j).Name & ","
Next j
Print #nlgFile, strUsers
Next i
'/now do the same thing with Groups ... I'll leave that up to you
Close #lngFile
End Function
Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com