The usual way to handle this is to check if the currently logged
on user is a member of a specific Group. So, for example, if
Bob logs in and wants to access a menu option, you first check
to see if Bob is a member of a Group that you wish to access
that option. If he is not a member that you want to access that
function, then you pop up a nice message box.
There are many functions out there to test for Group membership.
This one is straight out of the Security FAQ (with a few changes):
Public Function faq_IsUserInGroup(strGroup As String, _
strUser As String) As Boolean
' Returns True if user is in group, False otherwise
Dim ws As DAO.Workspace
Dim grp As DAO.Group
Dim strUserName As String
Set ws = DBEngine.Workspaces(0)
Set grp = ws.Groups(strGroup)
On Error Resume Next
strUserName = ws.Groups(strGroup).Users(strUser).Name
faq_IsUserInGroup = (Err = 0)
End Function
Copy and paste that code into a new standard module.
Make sure you set a reference to the DAO object library
if you have not already.
Make sure you name the module something other than
the function name. Like basSecurityFunctions for example.
To call the function you do this:
If faq_IsUserInGroup("SomeGroupNameHere",CurrentUser())=True Then
' They are a member so do something
Else
' They are not a member of that group so do something else
End If
--
Jeff Conrad
Access Junkie
Bend, Oregon
"tw" wrote in message