Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login form user rights Please help!

Status
Not open for further replies.

Jar80

Technical User
Jun 13, 2004
69
FI
My problems will continue.
I have login form which will be loaded in the start.

Form is maded using Login table which contains following fields. Employee id, username, password and user status.

In the login form is combobox which is used to select the employee and the password field. If username and password is correct then will be loaded mainform if not then it inform that the password or username is incorrect.
This work fine but, problem is that how i gonna use this login form to define user rights.

I mean user rights that when i login in admin then all buttons in the mainform is use but when user is employee then mainform some buttons are disabled.


 
You could use global boolean variables.
e.g.
Code:
Public adm as Boolean
Then in the login form set adm to TRUE or FALSE respectively and then in all forms you want to restrict, e.g. main form:
Code:
Private Sub Form_Current() 
Button1.enabled=adm
Button2.Enabled=adm
and so forth...

Hope this helps.

Cheers,
Andy

[blue]The last voice we will hear before the world explodes will be that of an expert saying:
"This is technically impossible!" - Sir Peter Ustinov[/blue]
HP:
 
Hi

This can become complicated, but simple solution to match what you say is to add a column (type yes/no) to your Login Table, called IsAdmin

Set the field to true for yourself, but false for all other employees

Then in the Mainform look uop the record of the logged in employee and set buttons enabled true/false depending on value if IsAdmin

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Not work or i don´t get it work.

I have added in the frmLogon form code (Admin=true)
then in the mainform code (Public Admin as Boolean) and
Employee.Enabled = Admin which is button in the mainform.

I have disabled button using access own function.
 
hi Jar,

possibly caused by your using "Admin" explicitely?
That's why I used "adm" as variable name, forgot to mention.

Have you tried Ken's solution, too?

What does "Not work" mean in detail?

Cheers,
Andy

[blue]The last voice we will hear before the world explodes will be that of an expert saying:
"This is technically impossible!" - Sir Peter Ustinov[/blue]
HP:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top