Hi,
I am trying to put a simple password on a command button on a form in order to open another form (if that makes sense).
I have the following code (which I found on another thread)
Private Sub Delmenu1_Click()
On Error GoTo Err_Delmenu1_Click
Retry:
Dim strInput As String
strInput = InputBox("Please Enter the Password", "Enter Password")
If strInputBox = "pass" Then
DoCmd.OpenForm "Frm_Deletions Main", acNormal
Else
If MsgBox("You entered the wrong password. Do you wish to try again?", vbQuestion + vbYesNo, "Password Error") = vbYes Then
GoTo Retry
End If
End If
Exit_Delmenu1_Click:
Exit Sub
Err_Delmenu1_Click:
MsgBox Err.Description
Resume Exit_Delmenu1_Click
End Sub
It will not recognise the password "pass" in this case and just keeps coming up with incorrect password. Can anyone who is better at code than me spot what the problem could be.
Thanks in advance!!!
I am trying to put a simple password on a command button on a form in order to open another form (if that makes sense).
I have the following code (which I found on another thread)
Private Sub Delmenu1_Click()
On Error GoTo Err_Delmenu1_Click
Retry:
Dim strInput As String
strInput = InputBox("Please Enter the Password", "Enter Password")
If strInputBox = "pass" Then
DoCmd.OpenForm "Frm_Deletions Main", acNormal
Else
If MsgBox("You entered the wrong password. Do you wish to try again?", vbQuestion + vbYesNo, "Password Error") = vbYes Then
GoTo Retry
End If
End If
Exit_Delmenu1_Click:
Exit Sub
Err_Delmenu1_Click:
MsgBox Err.Description
Resume Exit_Delmenu1_Click
End Sub
It will not recognise the password "pass" in this case and just keeps coming up with incorrect password. Can anyone who is better at code than me spot what the problem could be.
Thanks in advance!!!