I am trying to get my function to disable the "AllowBypassKey"(SHIFT) to work. NICKJAR2 helped considerably with setting the references. Here is the code:
Function DisableShift()
'This function will disable the shift at startup causing
'the Autoexec macro and Startup properties to always be executed
On Error GoTo errDisableShift
Dim db As DAO.Database
Const conPropNotFound = 3270
Set db = CurrentDb()
'This next line disables the shift key on startup.
db.Properties("AllowByPassKey"
= False
'function successful
Exit Function
errDisableShift:
'The first part of this error routine creates the "AllowByPassKey
'property if it does not exist.
If Err = conPropNotFound Then
Set Property = db.CreateProperty("AllowBypassKey", dbBoolean, False)
db.Properties.Append Property
Resume Next
Else
MsgBox "Function 'DisableShift' did not complete successfully."
Exit Function
End If
End Function
After the Set Property = db.CreatePropery... line
At the db.Properties.Append Property line the debugger is telling me telling me an Object is Required run-time error ‘424’.
Can any explain this problem? What Object am I missing?
Function DisableShift()
'This function will disable the shift at startup causing
'the Autoexec macro and Startup properties to always be executed
On Error GoTo errDisableShift
Dim db As DAO.Database
Const conPropNotFound = 3270
Set db = CurrentDb()
'This next line disables the shift key on startup.
db.Properties("AllowByPassKey"
'function successful
Exit Function
errDisableShift:
'The first part of this error routine creates the "AllowByPassKey
'property if it does not exist.
If Err = conPropNotFound Then
Set Property = db.CreateProperty("AllowBypassKey", dbBoolean, False)
db.Properties.Append Property
Resume Next
Else
MsgBox "Function 'DisableShift' did not complete successfully."
Exit Function
End If
End Function
After the Set Property = db.CreatePropery... line
At the db.Properties.Append Property line the debugger is telling me telling me an Object is Required run-time error ‘424’.
Can any explain this problem? What Object am I missing?