Private Sub bOpenFormClick_Click()
On Error GoTo Err_bOpenFormClick_Click
Dim strInput As String
Dim strMsg As String
Beep
strMsg = "These functions are used only by the special people." & vbCrLf & vbLf & "Please key the Special Form password to allow access."
strInput = InputBox(Prompt:=strMsg, title:="Special Form Password")
If strInput = "SpecialPassword" Then 'password is correct
Beep
DoCmd.OpenForm "fSpecialForm"
DoCmd.Close acForm, Me.Name
Else 'password is incorrect
Beep
MsgBox "Incorrect Password!" & vbCrLf & vbLf & "You are not allowed access to the special form.", vbCritical, "Invalid Password"
Exit Sub
End If
bEdit_Click_Exit:
Exit Sub
Err_bEdit_Click:
MsgBox Err.Number & " " & Err.Description
Resume bEdit_Click_Exit
Exit_bOpenFormClick_Click:
Exit Sub
Err_bOpenFormClick_Click:
ErrorMsg Me.Name, "bOpenFormClick_Click", Err.Number, Err.Description
Resume Exit_bOpenFormClick_Click
End Sub