billgyrotech
Banned
- Local time
- Today, 06:00
- Joined
- Apr 18, 2013
- Messages
- 258
I have the following code to protect a form. Either 'Houston' or 'Austin' will allow the form to open. The code is in the On Open event of the form.
************************
Private Sub Form_Open(Cancel As Integer)
Dim PassWord As String
PassWord = InputBox("Enter Password")
Cancel = (PassWord <> "Houston" And PassWord <> "Austin")
If Cancel Then MsgBox ("You are not authorized for access.")
End Sub
************************
My question is it possible to have a Password Table that this code gets the passwords from? This will be for different security levels to open forms. I have a Main Switchboard sectioned Users and Administrators. The Administrators area has forms that have this code for password protection.
Thanks for any help,
Bill
************************
Private Sub Form_Open(Cancel As Integer)
Dim PassWord As String
PassWord = InputBox("Enter Password")
Cancel = (PassWord <> "Houston" And PassWord <> "Austin")
If Cancel Then MsgBox ("You are not authorized for access.")
End Sub
************************
My question is it possible to have a Password Table that this code gets the passwords from? This will be for different security levels to open forms. I have a Main Switchboard sectioned Users and Administrators. The Administrators area has forms that have this code for password protection.
Thanks for any help,
Bill
Last edited: