Paste the following into a module and give it a name (mine is called
"bypass"):
Public Function SetProperties(strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Integer
On Error GoTo Err_SetProperties
Dim db As DAO.Database, prp As DAO.Property
Set db = CurrentDb
db.Properties(strPropName) = varPropValue
SetProperties = True
Set db = Nothing
Exit_SetProperties:
Exit Function
Err_SetProperties:
If Err = 3270 Then 'Property not found
Set prp = db.CreateProperty(strPropName, varPropType, varPropValue)
db.Properties.Append prp
Resume Next
Else
SetProperties = False
MsgBox "SetProperties", Err.Number, Err.Description
Resume Exit_SetProperties
End If
End Function
Paste the following into the "on click" event of a text box in a form (I
called mine "bDisableBypassKey"). Insert the password where it says "PASSWORD
HERE":
Private Sub bDisableBypassKey_Click()
Dim strInput As String
Dim strMsg As String
strMsg = "Please enter the password to enable the Bypass key"
strInput = InputBox(Prompt:=strMsg, title:=" ")
If strInput = "PASSWORD HERE" Then
SetProperties "AllowBypassKey", dbBoolean, True
MsgBox "The Bypass Key has been enabled", _
vbInformation, "Set Startup Properties"
Else
SetProperties "AllowBypassKey", dbBoolean, False
MsgBox "Incorrect Password. The Bypass Key was disabled", _
vbCritical, "Invalid Password"
Exit Sub
End If
End Sub
When you click on the text box you will get a password box. If it is
different, the shift bypass will be disabled.