AllowByPassKey is a custom property of MS-Access that was probably set by
the programmer to disable the Shift key by-pass. You may be able to run this
code from a different database by changing the line:
CurrentDb.Properties("AllowBypassKey") = blnLock
to:
Dim db As DAO.Database
Set db = db.OpenDatabase("Path to your database")
db.Properties("AllowBypassKey") = True
to pass the name of another database. If you cannot, the security has
stopped you cold.
Public Function LockDB(blnLock As Boolean)
'====================================================================
' Name: LockDB
' Purpose: Kill the Shift key
'
' Inputs: blnLock As Boolean
'
' Author: Arvin Meyer
' Date: April 19, 1999
' Comment: If blnLock = 0, the bypass key is activated,
' If blnLock = -1, the bypass key is deactivated
' Keep a copy of the database without this property
'====================================================================
On Error GoTo Err_LockDB
Dim prp As Property
Const PropertyNotFound = 3270
CurrentDb.Properties("AllowBypassKey") = blnLock
Exit_LockDB:
Exit Function
Err_LockDB:
'Create the property if not found.
If Err = 3270 Then
Set prp = CurrentDb.CreateProperty("AllowBypassKey", dbBoolean,
blnLock)
CurrentDb.Properties.Append prp
Resume Next
Else
Resume Exit_LockDB
End If
End Function
Also have a look at:
http://www.mvps.org/access/general/gen0040.htm
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads:
http://www.datastrat.com
http://www.mvps.org/access