I have this code and when i run it it comes up with a message "end if without block if", i'm new to if statements and not sure whats wrong.
Also the txt_box holds the value so when the form is opened, the password is still displayed which of course for a password isnt very appropriate. So any help would be appreciated
Private Sub Cmd_Enterpass_Click()
Dim strpass As String
strpass = txt_pass
If strpass = "ali" Then DoCmd.OpenForm "frmadmin"
DoCmd.Close
Exit Sub
End If
MsgBox "You do not have access", vbOKCancel
DoCmd.Close
End Sub
Also the txt_box holds the value so when the form is opened, the password is still displayed which of course for a password isnt very appropriate. So any help would be appreciated
Private Sub Cmd_Enterpass_Click()
Dim strpass As String
strpass = txt_pass
If strpass = "ali" Then DoCmd.OpenForm "frmadmin"
DoCmd.Close
Exit Sub
End If
MsgBox "You do not have access", vbOKCancel
DoCmd.Close
End Sub