The following functions will do this for you; in both directions. Please note, until you do the converse function, the last function you executed will remain in effect. Note also that these two functions are DAO and do not depend on ADOX. Therefore, watch your references.
Public Sub Disable()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
MsgBox "System Lockdown, the shift key has been blocked"
DoCmd.Quit
End Sub
Public Sub Enabler()
Dim db As Database
Set db = CurrentDb
db.Properties.Delete "AllowByPassKey"
db.Properties.Refresh
MsgBox "System open, the program is currently unlocked"
DoCmd.Quit
End Sub
HTH
Robert Berman
Data Base consultant
Vulcan Software Services
thornmastr@yahoo.com