Disable AllowBypassKey

  • Thread starter Thread starter Tony Uythoven
  • Start date Start date
T

Tony Uythoven

Exactly how do you disable the SHIFT key to bypass the startup properties.
The microsoft help file is not of much help.

Thanks,
Tony
 
Tony,

Here is a subroutine I use. Of course, you want to be extremely careful
about disabling the shift key control because you can disable yourself from
being able to use it. I would strongly recommend backing up your database
before incorporating this. And you will probably want to place a button on a
form that enables it for the database administrator.

Sub SetBypass(rbFlag As Boolean) ' set rbFlag=false to disable Bypass

On Error GoTo SetBypass_Error
Dim db As Database
Set db = CurrentDb
db.Properties!AllowBypassKey = rbFlag

SetByPass_Exit:
Exit Sub

SetBypass_Error:
If Err = 3270 Then
'AllowBypassKey property does not exist
db.Properties.Append db.CreateProperty("AllowBypassKey", dbBoolean,
rbFlag)
Resume Next
Else 'Some other error
MsgBox "Unexpected error: " & Error$ & " (" & Err & ")"
Resume SetByPass_Exit
End If

End Sub

Marvin
 
Back
Top