Private Sub bDeleteRecord_Click()
On Error GoTo Err_bDeleteRecord_Click
Dim strInput As String
Dim strMsg As String
' Me.tbHidden.SetFocus
Beep
strMsg = "Please key the Delete Password to allow the deletion of the current record."
strInput = InputBox(Prompt:=strMsg, Title:="Delete Password")
If strInput = "[COLOR=red]YourPasswordHere[/COLOR]" Then
Beep
DoCmd.RunCommand acCmdDeleteRecord
Refresh
Else
Beep
MsgBox "Incorrect Password!" & Chr(13) & Chr(13) & "You are not allowed to delete any table records." & Chr(13) & Chr(13) & "Please contact your database administrator for help.", vbCritical, "Invalid Password"
Exit Sub
End If
' Me.tbHidden.SetFocus
Exit_bDeleteRecord_Click:
Exit Sub
Err_bDeleteRecord_Click:
MsgBox Err.Number & " " & Err.Description
Resume Exit_bDeleteRecord_Click
End Sub