Simple access restrictions?

Takstein

Registered User.
Local time
Today, 11:49
Joined
Jan 31, 2007
Messages
54
Hi!

I am making a database for our department for resource planning. I have two versions of this one, where one is the master (With everyting) and one "user" version, where the idea is that the employee can only see hes/her data and have very limited access. The idea of the user version is that they can enter their hours but nothing more.

Any ideas on how i can restrict this? I have made a form with a filter on the name, so that each employee can select the name and only get up the related posts. The problem is that then they can select one of their coworkers as well and see their data.

Any ideas on an easy way to restrict this? Do i need a log in with password and everything?

I am using access 2010 by the way (accdb)..


any ideas would be appreciated!

Regards,
Takstein
 
Maintaining multiple database versions is a nightmare. I wouldn't do it. You will need to add a login form. That form can capture the user's ID and store it in a hidden field for future use.
Me.MyHiddenField = Environ("UserName")

The Environ() function returns many coputer settings fields. UserName is the name of the user who logged on to this computer. The login form should allow for the entry of a a password and it should look up a flag that indicates if the user can see only his own records or if he can see/change others. Then the login form opens the main menu/switchboard and hides itself. You can change the queries to reference this hidden login form and if the user is restricted to his own records only, use that to restrict the records returned.

Select ...
From ...
Where ... AND (ChangedByUser = '" & Forms!frmLogin!txtUserName & "' OR Forms!frmLogin!chkAdminAccess = True);
 
The Environ function seems elegant and EXACTLY what i need.

Thanks!:D
 

Users who are viewing this thread

Back
Top Bottom