Please assist me..I have developed a simple application in access 2007. I have a login screen which authenticates the user against details in a user table and if this is successfull it opens the switchboard and closes the login screen.On the switchboad i have 3 buttons.
The above setup works fine, what i am now struggling with is to implement a security feature, I have updated my user table to have a boolean field named group, what i am hoping to achieve is to distinguish different users based on this boolean value e.g. if the value is 0 the user will be able to see all the 3 buttons on the switchboard and if the value is 1 the reports button must be disabled.
This is a code i have so far and it doesnt work...im not use if the best place to put the code is on the on-click event of the submit button on login screen or on the form load of the switchboard
Code:
Dim stDocName As String
Dim stLinkCriteria As String
Dim varX As Variant
varX = DLookup("[group]", "Table1", "[username] = '" & [Combo2] & "'") stDocName = "Switchboard"
DoCmd.OpenForm stDocName, , , stLinkCriteria If varX = 1 Then
Forms![Switchboard]!Option3.Enabled = False End If
---------
Table1 = name of user table
Combo2 = name of combo box on login form that lists users names
Option3 = name of reports button on switchboard