Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with VB Script & Macro...PLEASE!!

Status
Not open for further replies.

kmkland

Technical User
Dec 15, 2004
114
US
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:
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
The macro "PasswordSecurity" has the following conditions:
Code:
Condition                                           Action        Argument
[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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top