How do I allow a specific user permission to process only certain records

dewsbury

Registered User.
Local time
Today, 09:06
Joined
Jul 4, 2008
Messages
57
Example.

user/login john belongs to department 102.
user/login paul belongs to department 202
(the login is the same as the overall database login)

Two tables in database.

Employee Table has two fields : user , department (**** the user here is intended to be the same a the access login)

Salary table has 3 fields : department, name, salary.


I want to create a single form so that when john logs in he can ONLY see the salary of those in his department (102) etc.

My solution is to create a form where the department number defaults to the department in the employee table. I.e. if the user logs in as John then the department will default to 102. This field is then not editable.

I can't figure out the query/macro? that I need to achieve what I described in the previous paragraph. How do I do this??
 
Last edited:
Hi

See the attached it should give you some idea, look at the after update event of Text0 on the form and the On click event of the command button.

Also see the criteria in Query3
 

Attachments

Thanks Michael,

Unfortunately where I click on the specified areas I expected to see a bit of code but I see nothing!

I am using Access 2000 ... I presume that this is not a problem??
 
Sorry my fault, didnt copy code in, try this one.

You need to type Paul or John in Text0 and tab.

If you want to automatically pick up the user logged in the database, which looking at your original question you do, set the control source of the text0 to =CurrentUser.

Access 2000 isnt a problem, this is 2000 also.
 

Attachments

Last edited:

Users who are viewing this thread

Back
Top Bottom