table query

kingsgambit

Registered User.
Local time
Today, 18:15
Joined
May 27, 2001
Messages
134
I tried a similar question in gerneral bur no replys.I have a login form where the user puts there username and password and security is already set, the vb code runs a query and if the query matches the user input it open the main menu.
I would like to design a form with check boxes relating to the buttons on the main menu. so that the administrator could tick which buttons the user would be aloud to use.
The main menu work simple by, if the security level is "admin" then Me.Command1.Enabled = True.How would I get the form to look up the table where the check boxes are stored. If I could do this then the vb code would simple be If checkbox=yes then Me.Command1.visible=true
 
Hold a security level for each user held as a table field, At login set a public variable to reflect the users permissions then in the OnOpen event of every form check if the security level is appropriate:-

If Me.Tag < bytUserLevel Then
Msgbox "No Entry Allowed, your administrator has limited your access", vbOK + vbExclamation,"ERROR!"
Docmd.Close
End if

Of course, opening the form could be avoided by putting the same code in button event and holding the forms security level in the button tag.
 

Users who are viewing this thread

Back
Top Bottom