autoExec macro headache
I picked up the following code from this site:
'This Code disables the shift key
'**********************************
Public Sub SetAllowByPassKeyProperty()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
End Sub
It’s meant to disable the shit key when somebody logs on to access, I’ve plaec it in a standard code module & it’s called by the below function:
Public Function callAllowByPassKeyProperty()
Call SetAllowByPassKeyProperty
End Function
The above function is stored in an AUTOEXEC macro made up of a single runCode action, the callAllowByPassKeyProperty() is the only function name provided as the argument.
When I run the database I get the following run time error ‘Can’t append – an object with that name already exists in the collection – run time error 3367’
I picked up the following code from this site:
'This Code disables the shift key
'**********************************
Public Sub SetAllowByPassKeyProperty()
Dim db As Database
Dim prp As Property
Set db = CurrentDb
Set prp = db.CreateProperty("AllowByPassKey", dbBoolean, False)
db.Properties.Append prp
End Sub
It’s meant to disable the shit key when somebody logs on to access, I’ve plaec it in a standard code module & it’s called by the below function:
Public Function callAllowByPassKeyProperty()
Call SetAllowByPassKeyProperty
End Function
The above function is stored in an AUTOEXEC macro made up of a single runCode action, the callAllowByPassKeyProperty() is the only function name provided as the argument.
When I run the database I get the following run time error ‘Can’t append – an object with that name already exists in the collection – run time error 3367’