password protected login (1 Viewer)

jlabre01

Registered User.
Local time
Yesterday, 20:18
Hi,

I have recently migrated my access 2003 database to sql server 2005 and i linked the tables, etc. in sql to the access versions, so that the company I work for can still use the access version of everything. I wanted to know if it would be easier to make a form in access for login purposes in order to allow people access to certain tables, forms,etc. or if I should do something else?

jlabre01
 

TylerTand

Registered User.
Local time
Yesterday, 17:18
If the users have a login to the computers at their work that is unique you could use that as the password. Try messing around with a unbound field and set the record source to : =environ$("username") . I use this all the time to control who can get into my databases and then what they can do. If you find that your employees have unique values, let me know and I have a bunch of code that will help you.
Tyler
 

jlabre01

Registered User.
Local time
Yesterday, 20:18
hey Tyler,
Ya your idea would work because everyone has a unique login. I would appreciate any help in setting restrictions to certain tables/forms, as I am still new at this.

jlabre01
 

TylerTand

Registered User.
Local time
Yesterday, 17:18
One of the easiest ways to restrict access is through the button that opens the form. Set the On Open Property for the Form containing the button. Insert this code in the On Open procedure

if environ$("username")= 'unique ID Here' then command43.visible=false

In this example command43 is a button to open a form you don't want them to be able to open. This is a simple solution. A more complex solution is to have security profiles for users that you want to be able to apply a group of people. That way you wouldn't have to write the individual code for each person. I have one databse that you initially open that references another with a table for Login information. The Table has the Unique computer number and a permission level. When the LogIn Db is opened it checks the username against a table in the main Db to see if that person has permission to even get into the database. If he does he then has a user profile based on his permission level that can be referenced on forms. That way you can say if the Currentuser= "Supervisors" then command43.visible=true else command43.visible=false. A profile makes it easy to assign priveliges to a large group of people without referencing them individually.
 

Users who are viewing this thread

Top Bottom