Discussion Locked

Access 97 - Restrict Records by login

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I want to create a login procedure that restricts the user from seeing any records that they are not assigned to as a user on that record.

Table has a user id field. Based on the user id field I want to see only the records that are mine. If it's a query I won't be able to update the underlying records.

Also need to include a override user that could see all - i.e. management.

Example: A contact mgmt database where I only see the contacts that are mine and not the whole company.

5 replies

by morriskg

One way is to use the Filter property of your form. Take a look a the help and examples given. They should be enough to get you on your way.

For example, this code would be in the OnOpen event.
Me.Filter = "UserID = 'moriskg'"
Me.FilterOn = True

To do the administrator view where you can see all records you would just not set the Filter if the UserID = 'Admin' or whatever.

by donq

If the Table has a User ID field as you say create a query using the Table as the data source and filtering the User ID field. To enforce Data Integrity (or Security) you may need to create a Workgroup and have each User log into a User Level security system for your "mdb" file. User level security is the ONLY way to INFORCE complience, and filtered queries are the ONLY way (I know of) to insure users only see what they have permissions to see. Good luck.

Find "wrkgadm.exe" on your PC andclick it to define a new Workgroup. Then join it and add your ID and password and become the new Admins "guru". Delete the Admins - "Admin" user and you have the beginning of a User Level secured database.

This discussion is closed to new replies.