ACC1x: Error When Using OpenQueryDef Method on Parameter QueryLast reviewed: June 6, 1997Article ID: Q100147 |
The information in this article applies to:
SYMPTOMSWhen you are using the OpenQueryDef method on a parameter query, the error message "Couldn't Find Object" appears when you re-create the sample code on page 137 of the Microsoft Access "Introduction to Programming" manual.
CAUSEThere are three likely causes for this error message:
RESOLUTIONThe following sample function is a correction to the errors in the sample on page 137 of the Microsoft Access "Introduction to Programming" manual:
'*****************************************************************
' Declarations section of the module
'*****************************************************************
Option Explicit
Function TestQP ()
Dim db As Database, Q As QueryDef, DataRecs As Dynaset
Set db = CurrentDB()
Set Q = db.OpenQueryDef("Products by Category (Parameter)")
Q![Enter a category id:] = "COND" 'This is an explicit parameter
Set DataRecs = Q.CreateDynaset()
DataRecs.Close
Q.Close
End Function
|
Keywords : DcmMnl kberrmsg kbprg PgmOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |