rockman
Senior Member
- Local time
- Today, 14:47
- Joined
- May 29, 2002
- Messages
- 190
Question about parameters in a querydef
Pat Hartman has stated that it is more efficient to use a querydef than dynamic SQL. I've read over his post of HowJetHandlesQueriesAgainstODBCDatasources.doc, but I have questions.
I have a form "frmCustomer" and I have a querydef "qryCustomer" based on my table "tblCustomers". On my form I have a textbox (txtCurrentCustomerID) that will contain the record that I wish to view.
If I place criteria within my qryCustomer to the effect: fldCustomerID = forms!frmCustomer!txtCurrentCustomerID, I get prompted to manually enter a value for txtCurrentCustomerID (assumedly because the control doesn't exist yet in the early sequence of opening the form).
I guess it boils down to, "How do I pass a parameter to the querydef to return only the single record I wish to view while the form is opening?"
Does my question make sense?
Thanks for any help,
Jeff
Pat Hartman has stated that it is more efficient to use a querydef than dynamic SQL. I've read over his post of HowJetHandlesQueriesAgainstODBCDatasources.doc, but I have questions.
I have a form "frmCustomer" and I have a querydef "qryCustomer" based on my table "tblCustomers". On my form I have a textbox (txtCurrentCustomerID) that will contain the record that I wish to view.
If I place criteria within my qryCustomer to the effect: fldCustomerID = forms!frmCustomer!txtCurrentCustomerID, I get prompted to manually enter a value for txtCurrentCustomerID (assumedly because the control doesn't exist yet in the early sequence of opening the form).
I guess it boils down to, "How do I pass a parameter to the querydef to return only the single record I wish to view while the form is opening?"
Does my question make sense?
Thanks for any help,
Jeff
Last edited: