Disable shift key in MS Access 2003
Posted on 2007-10-01
I am trying to disable the shift key in my MS Access 2003 application so that users cannot bypass the runtime MDE properties and access the design view where they have a full version of MS Access. I have found the following code in the Microsoft knowledgebase but cannot make it work in my application. Do I need to modifications to this code to make it work?
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, False
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, _
' Unknown error.
ChangeProperty = False
Any help would be appreciated.