Restricting access to records

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top