Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

enable/disable allowbypasskey

Status
Not open for further replies.

novice24

Technical User
Jun 20, 2001
17
0
0
US
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?

 
The only thing I can see is that the object 'Property' does not appear to have been declared. You need to declare it as type Property before you can use it in your code. Alex Middleton
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top