So I have my main form linked to all the other forms. I have set password to protect any one from opening. The codes I have is
Private Sub Form_Open(Cancel As Integer)
Dim stDocName As String
Dim stLinkCriteria As String
Dim PassWordtxt
PassWordtxt = InputBox("Please Type in password")
If PassWordtxt = "password" Then
stDocName = "frmMainMenu"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "The password provided was incorrect - you do not have permission"
End If
End Sub
It works fine except that when I type the wrong password, it shows me the MsgBox "The password provided was incorrect - you do not have permission" and then opens my main form.
Any suggestions anyone?