Hello All --
I need some assistance if possible. I am needing help with a password form I have. I have a table named PasswordTable with a single password in it and a password form named AdminForm. On the form I have an unbound text box named PasswordTextBox , a close button and a Submit button. I can get the code to work when I just want to open 1 form by using the following code:
What I need to happen is be able to call the password form up from multiple buttons on click and open up that form based on the button that was clicked. For instance; If I click view report button it opens the password form and if password is successfully entered then it closes the password form then opens the report. If I click on a different button that would open a different form it too will call the password form and if the password i s successfully entered it would close the password form and then open up what was intended. In any even if the user closes or cancels the password form without putting in the correct password it will not open up anything that was clicked initially.
I am not sure how to go about this if someone could please assist me.
Thanks!
I need some assistance if possible. I am needing help with a password form I have. I have a table named PasswordTable with a single password in it and a password form named AdminForm. On the form I have an unbound text box named PasswordTextBox , a close button and a Submit button. I can get the code to work when I just want to open 1 form by using the following code:
Code:
Private Sub Submit_Click()
If DLookup("AdminPassword", "PasswordTable") = Me.PasswordTextBox Then
DoCmd.Close
DoCmd.OpenForm "Form_to_Open", acNormal
Else
MsgBox "Incorrect Password! Try again!"
PasswordTextBox.SetFocus
Me.PasswordTextBox = ""
End If
End Sub
What I need to happen is be able to call the password form up from multiple buttons on click and open up that form based on the button that was clicked. For instance; If I click view report button it opens the password form and if password is successfully entered then it closes the password form then opens the report. If I click on a different button that would open a different form it too will call the password form and if the password i s successfully entered it would close the password form and then open up what was intended. In any even if the user closes or cancels the password form without putting in the correct password it will not open up anything that was clicked initially.
I am not sure how to go about this if someone could please assist me.
Thanks!