All,
I am working on a switch board in Access 2007 which has 2 buttons. Each button allows users to open a different form. One form is for all users, the other form I want to restrict to certain people only to be able to enter. I have created an on click input box that will ask the user for the password. How do I assign the below code to this button so it will allow access to the people with the password only? I have no idea how to assign a code to a button. I tried to run in it module, but did not work. Your help is appreciated!!!!
If InputBox("Password") = "password" Then
DoCmd.CancelEvent
Else
MsgBox "You are not authorized!", vbOKOnly
DoCmd.Close
End If
I am working on a switch board in Access 2007 which has 2 buttons. Each button allows users to open a different form. One form is for all users, the other form I want to restrict to certain people only to be able to enter. I have created an on click input box that will ask the user for the password. How do I assign the below code to this button so it will allow access to the people with the password only? I have no idea how to assign a code to a button. I tried to run in it module, but did not work. Your help is appreciated!!!!
If InputBox("Password") = "password" Then
DoCmd.CancelEvent
Else
MsgBox "You are not authorized!", vbOKOnly
DoCmd.Close
End If