Private Sub Command1_Click() On Error GoTo ErrorPoint If Len(Nz(Me!PassTextBox, "")) = 0 Then MsgBox "Please enter a password before continuing." _ , vbCritical, "Missing Password" Me.PassTextBox.SetFocus Else If Me.PassTextBox <> "password" Then ' Substitute with your own password between the quotes MsgBox "Incorrect Password", vbExclamation, "Access Denied" Me.PassTextBox = "" Me.PassTextBox.SetFocus Else Forms!Switchboard.Filter = "[ItemNumber] = 0 And [SwitchboardID] = 2" Forms!Switchboard.Refresh DoCmd.Close acForm, "PasswordForm" End If End If ExitPoint: Exit Sub ErrorPoint: ' Unexpected Error MsgBox "The following error has occurred:" _ & vbNewLine & "Error Number: " & Err.Number _ & vbNewLine & "Error Description: " & Err.Description _ , vbExclamation, "Unexpected Error" Resume ExitPoint End Sub
Thank you for any help!

New Topic/Question
Reply



MultiQuote




|