K
Khartoum
I have a password form: depending on the password a particular form will open
by an 'on click' event as below:
Private Sub okbutton_Click()
If Forms![password form].text_password = "atay" Then DoCmd.OpenForm "Angela
Taylor" _
Else: If Forms![password form].text_password = "dgra" Then DoCmd.OpenForm
"Dave Graham" _
Else: MsgBox "You have entered an incorrect password", vbOKCancel
DoCmd.Close acForm, "password form", acSaveNo
End Sub
When i add the same code to an 'on enter' event it gives me a runtime error
2585, opens the form anyway but highlights:
DoCmd.Close acForm, "password form", acSaveNo
Can anybody shed some light on this
Thanks
by an 'on click' event as below:
Private Sub okbutton_Click()
If Forms![password form].text_password = "atay" Then DoCmd.OpenForm "Angela
Taylor" _
Else: If Forms![password form].text_password = "dgra" Then DoCmd.OpenForm
"Dave Graham" _
Else: MsgBox "You have entered an incorrect password", vbOKCancel
DoCmd.Close acForm, "password form", acSaveNo
End Sub
When i add the same code to an 'on enter' event it gives me a runtime error
2585, opens the form anyway but highlights:
DoCmd.Close acForm, "password form", acSaveNo
Can anybody shed some light on this
Thanks