Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
MsgBox "ByPass Key Disabled"
ExitCode:
Exit Sub
ErrorHanderling:
If Err.Number = ErrorNumber Then
MsgBox "Shift Key Is Disabled"
End If
Resume ExitCode
End Sub
'This Code Re-enables the Shift Key
Public Sub EnableByPassKeyProperty()
On Error GoTo ErrorHanderling
Const ErrorNumber = 3265
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
MsgBox "ByPass Key Re-Enabled"
ExitCode:
Exit Sub
ErrorHanderling:
If Err.Number = ErrorNumber Then
MsgBox "Shift Key Is Enabled"
End If
Resume ExitCode
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.