How To Disable Shift Key Bypass In Access 97
Posted on 2000-03-31
I found the following code in the answer to another question on the same subject, but I don't know what to do with it. I tried creating a new module and pasting the code into it, but I was not able to run the module.
Please give me step by step instructions if you can.
'======== THE CODE FOLLOWS ========
Function faq_DisableShiftKeyBypass() As Boolean
'The next time the database is opened
' after this function has been run,
' the autoexec macro will not be bypassed,
' even if the shift key is pressed.
On Error GoTo errDisableShift
Dim db As Database
Dim prop As Property
Const conPropNotFound = 3270
Set db = CurrentDb()
db.Properties("AllowByPassKey") = True
faq_DisableShiftKeyBypass = True
'The AllowBypassKey property is a user-defined
' property of the database that must be created
' before it can be set. This error code will execute
' the first time this function is run in a database.
If Err = conPropNotFound Then
Set prop = db.CreateProperty("AllowByPassKey", _
MsgBox "Function DisableShiftKeyBypass did" & _
" not complete successfully."
faq_DisableShiftKeyBypass = False