K
Khartoum
I have a password form, the code behind the OK button is as follows:
Private Sub okbutton_Click()
If Forms![password form].text_password = "fav1m" Then DoCmd.OpenForm "name1"
Else: If Forms![password form].text_password = "ro488" Then DoCmd.OpenForm
"name2" _
Else: If Forms![password form].text_password = "cb831" Then DoCmd.OpenForm
"name3" _
Else: If Forms![password form].text_password = "pc955" Then DoCmd.OpenForm
"name4"
Else: MsgBox "You have entered an incorrect password", vbOKCancel
DoCmd.Close acForm, "password form", acSaveNo
End Sub
So depending on the password, a particular form will open (each form has to
be secure) but as there are over 20 forms i keep getting a message about too
many continuation lines. Can anybody help me with the code to prevent this
Thanks John Mc
Private Sub okbutton_Click()
If Forms![password form].text_password = "fav1m" Then DoCmd.OpenForm "name1"
Else: If Forms![password form].text_password = "ro488" Then DoCmd.OpenForm
"name2" _
Else: If Forms![password form].text_password = "cb831" Then DoCmd.OpenForm
"name3" _
Else: If Forms![password form].text_password = "pc955" Then DoCmd.OpenForm
"name4"
Else: MsgBox "You have entered an incorrect password", vbOKCancel
DoCmd.Close acForm, "password form", acSaveNo
End Sub
So depending on the password, a particular form will open (each form has to
be secure) but as there are over 20 forms i keep getting a message about too
many continuation lines. Can anybody help me with the code to prevent this
Thanks John Mc