Thanks thebigthing313,
The reason I am doing it this way is the database needs to be developed for 2003-2013 users since the organization here is spread across the board. It's a customish security I have created. Uses a table in the DB to store privileges that's hidden. I then check privileges when the database opens and adjust items based on user level.
I then have a separate database that links to the permissions table - this is like the key. If you have admin privileges you can see a management menu where you can toggle the database lock on and off.
Not ideal but I am hoping it gets the job done.
For those of you with the same problem I had, to set the property:
Code:
Function CreateProperty(PropName As String, dbType As Variant, PropValue As Variant)
Dim DB As Database
Dim P As Property
Set DB = DBEngine(0)(0)
Set P = DB.CreateProperty(PropName, dbType, PropValue)
DB.Properties.Append P
End Function
Sub RunCreateProperty()
CreateProperty "AllowBypassKey", dbBoolean, True
End Sub
I just created a module, you can manually run the CreateProperty code by placing your cursor in the Sub and clicking Run. You could also append it to a button or however you like. I set it to True as that's the default.
To toggle it add this code to a button etc:
Code:
Public dbThis As DAO.Database 'Declared in a modGlobal module
dbThis.Properties("AllowBypassKey") = False
Thank you for the help and hopefully that helps others.