Hi experts,
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?
Sub SetBypassProperty()
Const DB_Boolean As Long = 1
ChangeProperty "AllowBypassKey", DB_Boolean, False
End Sub
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
Change_Bye:
Exit Function
Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strProp
Name, _
varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function
Any help would be appreciated.
Regards,
Terry
Start Free Trial