Restricting access to records

G

Guest

Trying to restrict multiple users' ability to view records in database.
Tried "Current User" in Query without luck. Ideally, each user sees only
their own records but managers can view all records.
 
J

Joan Wild

The function you want is CurrentUser() set as a criteria on a field that
contains the Access username.

As for managers viewing all records, I'd check to see if the CurrentUser()
is a member of the Managers Group, and if it is, change the RecordSource of
the Form.
Me.RecordSource = "SELECT * FROM tblWhatever"
If they're not in the Managers Group
Me.RecordSource = "SELECT * FROM tblWhatever WHERE CreatedBy = CurrentUser()

There is code in the security FAQ you can use to determine if a user is a
member of a group.
http://support.microsoft.com/?id=207793
 

Ask a Question

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.

Ask a Question

Top