I have a code for enabling a command button to password protect the enabling/disabling of the Shift bypass. For some reason though I keep recieving a syntax error when I try to use it. I copied the code from the following link:
http://www.databasedev.co.uk/disable_shift_bypass.html It seems to have a problem with the part that reads:
MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
"The Shift key will allow the users to bypass the startup & _
options the next time the database is opened.", _
vbInformation, "Set Startup Properties"
I did not really understand the first part of the directions about setting my references, so I don't know if that is the reason it is failing?
Any comments would be greatly appreciated.
Thanks.
Here is my full code behind the command button:
-
-
On Error GoTo Err_bDisableBypassKey_Click
-
'This ensures the user is the programmer needing to disable the Bypass Key
-
Dim strInput As String
-
Dim strMsg As String
-
Beep
-
strMsg = "Do you want to enable the Bypass Key?" & vbCrLf & vbLf & _
-
"Please key the programmer's password to enable the Bypass Key."
-
strInput = InputBox(Prompt:=strMsg, Title:="Disable Bypass Key Password")
-
If strInput = "burlington" Then
-
SetProperties "AllowBypassKey", dbBoolean, True
-
Beep
-
MsgBox "The Bypass Key has been enabled." & vbCrLf & vbLf & _
-
"The Shift key will allow the users to bypass the startup & _
-
options the next time the database is opened.", _
-
vbInformation, "Set Startup Properties"
-
Else
-
Beep
-
SetProperties "AllowBypassKey", dbBoolean, False
-
MsgBox "Incorrect ''AllowBypassKey'' Password!" & vbCrLf & vbLf & _
-
"The Bypass Key was disabled." & vbCrLf & vbLf & _
-
"The Shift key will NOT allow the users to bypass the & _
-
startup options the next time the database is opened.", _
-
vbCritical, "Invalid Password"
-
Exit Sub
-
End If
-
Exit_bDisableBypassKey_Click:
-
Exit Sub
-
Err_bDisableBypassKey_Click:
-
MsgBox "bDisableBypassKey_Click", Err.Number, Err.Description
-
Resume Exit_bDisableBypassKey_Click
-
-
End Sub
-