Passing parameters to a parameter query

B

Ben

Hi all,

I would like t o pass two dates as a date range from my VBA code using DAO
3.6 to an existing parameter query that is expecting two dates parameter in
Access. I have in my vba code routines to obtain the two dates and here's
where I am stuck: I am not sure how to call the query and pass the two dates
to it. Thanks for sharing your thoughts and suggestions.

Ben



--
 
D

David Lloyd

Ben:

You can set the value of the parameters through the Parameters collection of
the QueryDef object. For example.

'Qd is a QueryDef object

Qd.parameters("Beginning Date") = FirstDate
Qd.parameters("Ending Date") = LastDate

Once the parameter values are set, you can call the Execute or OpenRecordset
method of the QueryDef object to execute the query.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


Hi all,

I would like t o pass two dates as a date range from my VBA code using DAO
3.6 to an existing parameter query that is expecting two dates parameter in
Access. I have in my vba code routines to obtain the two dates and here's
where I am stuck: I am not sure how to call the query and pass the two dates
to it. Thanks for sharing your thoughts and suggestions.

Ben



--
 
Top