I have created a security form (frmSecurity) which is based on tblSecurity. (tblSecurity lists 3 different passwords.) In frmSecurity, I have an unbound text field (txtPWordInput) with the Input Mask set to Password and nothing in the Control Source. I have another unbound text field (txtPassword) bound to the Password field in tblSecurity and Visible is set to False.
The command button on frmSecurity has this code attached to it:
The macro "PasswordSecurity" has the following conditions:
Now, whenever I enter a correct password from the tblSecurity Password field into the frmSecurity form, the message box is displayed. What am I doing wrong!?!? I think that the answer lies in the conditions of my macro.
Any and all help will be greatly appreciated!!!
(I have used previous enquiries from the forums to help with this matter, but I still have not yet been able to solve my problem.)
Rgds,
kmkland
The command button on frmSecurity has this code attached to it:
Code:
Private Sub btnEnterPassword_Click()
If Me.txtPWordInput = Me.txtPassword Then
DoCmd.RunMacro "PasswordSecurity"
Else
MsgBox "The password entered is incorrect"
End If
End Sub
Code:
[b]Condtion Action Argument[/b]
[Forms]![frmSecurity]![txtPWordInput]='password1' OpenForm frmEmpInfo
[Forms]![frmSecurity]![txtPWordInput]='password2' OpenForm frmEmpID
[Forms]![frmSecurity]![txtPWordInput]='password3' OpenReport rptEmpAbs
Now, whenever I enter a correct password from the tblSecurity Password field into the frmSecurity form, the message box is displayed. What am I doing wrong!?!? I think that the answer lies in the conditions of my macro.
Any and all help will be greatly appreciated!!!
(I have used previous enquiries from the forums to help with this matter, but I still have not yet been able to solve my problem.)
Rgds,
kmkland