Passing parameters to a parameter query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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



--
 
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



--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top