You can use Albert Kallal's utility (of course your users could also use it
to re-enable the shiftkey, if they know about it).
You can minimise those chances by using code to detect that the admins group
is being used:
Sub SetBypassProperty()
'Tries to set the AllowBypassKey property and creates it if it fails to find
it.
'Calls libChangePropertyDdl
Const DB_Boolean As Long = 1
ChangePropertyDdl "AllowBypassKey", DB_Boolean, False
End Sub
Function ChangePropertyDdl(stPropName As String, PropType As
DAO.DataTypeEnum, vPropVal As Variant) As Boolean
' Uses the DDL argument to create a property that only Admins can change.
' Current CreateProperty listing in Access help is flawed in that
' anyone who can open the db can reset properties, such as AllowBypassKey
On Error GoTo ChangePropertyDdl_Err
Dim db As DAO.Database
Dim prp As DAO.Property
Const conPropNotFoundError = 3270
Set db = CurrentDb
' Assuming the current property was created without
' using the DDL argument. Delete it so we can
' recreate it properly
db.Properties.Delete stPropName
Set prp = db.CreateProperty(stPropName, PropType, vPropVal, True)
db.Properties.Append prp
' If we made it this far, it worked!
ChangePropertyDdl = True
ChangePropertyDdl_Exit:
Set prp = Nothing
Set db = Nothing
Exit Function
ChangePropertyDdl_Err:
If Err.Number = conPropNotFoundError Then
' We can ignore when the prop does not exist
Resume Next
End If
Resume ChangePropertyDdl_Exit
End Function
Keith.
www.keithwilby.com