maxxximaniac
Registered User.
- Local time
- Yesterday, 17:36
- Joined
- Oct 22, 2004
- Messages
- 80
Good day,
I am comming across a small problem that I am leading to think is the incorrect way to use the AND operator, although not sure.
I have a login form with Username/Password/Unit fields.
When the user Chooses their user name, Their Unit is populated by a hidden field.
I have a code on a login button, where if the passwords match against a password table, then open a form based on the Unit.
I had this line before which excluded the unit field and it works fine.
Thank you!
I am comming across a small problem that I am leading to think is the incorrect way to use the AND operator, although not sure.
I have a login form with Username/Password/Unit fields.
When the user Chooses their user name, Their Unit is populated by a hidden field.
I have a code on a login button, where if the passwords match against a password table, then open a form based on the Unit.
Code:
[COLOR="Navy"] If [/COLOR]Me.PasswordInput <> Me.Password [COLOR="navy"]Then [/COLOR]MsgBox "User/Password Incorrect!", vbCritical, "Error!"
[COLOR="navy"]If [/COLOR]Me.PasswordInput = Me.Password [COLOR="navy"]And [/COLOR]Me.Unit = "Batching" [COLOR="navy"]Then [/COLOR]DoCmd.OpenForm "frm_EnterProductionBatching", acNormal
[COLOR="navy"]If [/COLOR]Me.PasswordInput = Me.Password [COLOR="navy"]And [/COLOR]Me.Unit = "Exceptions" [COLOR="navy"]Then [/COLOR]DoCmd.OpenForm stDocName, , , stLinkCriteria
I had this line before which excluded the unit field and it works fine.
Code:
[COLOR="navy"]If [/COLOR]Me.PasswordInput = Me.Password [COLOR="navy"]Then [/COLOR]DoCmd.OpenForm stDocName, , , stLinkCriteria
Thank you!