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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

boldParameter query in DAO

Status
Not open for further replies.

bllgnn

Programmer
Jan 20, 2002
42
I'm having trouble trying to create a recordset from a query with 2 parameters, one of which might be null.

I learned recently on this great forum that running a query from a *form* to use the following on the Criteria row of the query if one of the parameters might be null.

Like "*" & [Forms]![frmEngines]![txtEngine]

Can someone tell me how to do this in DAO?

Here's a snippit of my code that doesn't work.

Set qdParts = MyDb.QueryDefs("qryPartsSold")
'set the parameters of the query
qdParts.Parameters("Please enter EngineID") = rsSalesTx!EngineID
qdParts.Parameters("Please enter ComponentID") = rsSalesTx!ComponentID
'open a recordset based on the QueryDef object
Set rsParts = qdParts.OpenRecordset

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top