B
bermetj
I have a switchboard and want to password protect one of the reports.
So Switchboard opens a form (frm Password) which has a text field for
password (txt Password). If password is correct report opens, if
incorrect it gives a message box saying that the pasword is incorrect,
please try again. However when I am trying to close the form, it gives
me a run-time error 2585. Here is the code. Thank you!
Private Sub cmd_Submit_Enter()
Dim strPassword As String
strPassword = Me![txt Password]
If strPassword = "emergency" Then
DoCmd.OpenReport "rpt Emergency Posting", acViewPreview
Else
MsgBox ("The password you entered is incorrect, please try again.")
Me![txt Password] = Null
End If
DoCmd.close acForm, "frm Password"
End Sub
So Switchboard opens a form (frm Password) which has a text field for
password (txt Password). If password is correct report opens, if
incorrect it gives a message box saying that the pasword is incorrect,
please try again. However when I am trying to close the form, it gives
me a run-time error 2585. Here is the code. Thank you!
Private Sub cmd_Submit_Enter()
Dim strPassword As String
strPassword = Me![txt Password]
If strPassword = "emergency" Then
DoCmd.OpenReport "rpt Emergency Posting", acViewPreview
Else
MsgBox ("The password you entered is incorrect, please try again.")
Me![txt Password] = Null
End If
DoCmd.close acForm, "frm Password"
End Sub