My Front end application in Access requires the fullest possible security. To this extent I am disabling the special keys so users cannot do the hold down SHIFT bypass, nor can they access the database window via the F11 key once the database is open.
Obviously I want to be able to access the code and database objects. What I need to do is have a button which enables the special keys and therefore enables the F11 key to access the database window. I can use an if statement and read the MDW file to test if it is my logon.
I am using the following Module
Public Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Object, prp As Variant
Const conPropNotFoundError = 3270
Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, _
ChangeProperty = False
Public Function BypassKey(onoff As Boolean)
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, onoff
And I am calling the code via the code in a button which is:
However, when I click on the button to call the code above, hitting F11 after does nothing. Is it possible to achieve the above?