Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Security / February 2006

Tip: Looking for answers? Try searching our database.

Restricting access to records

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Susan Yager - 27 Feb 2006 21:11 GMT
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.
Joan Wild - 27 Feb 2006 22:19 GMT
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

Signature

Joan Wild
Microsoft Access MVP

> 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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.