Code:
Private Sub btnConfirm_Click()
On Error Resume Next
DoCmd.Close acForm, Me.Name
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim password As String
password = "closeme"
If enterpassword <> password Then
Cancel = -1
MsgBox "Incorrect password!", vbExclamation
End If
End Sub
It works except if I press the confirm button with no text entered into the box it'll act as if the password is correct, wheres the simple error?