Passing form data to a query thru a macro

Joined
Jan 19, 2006
Messages
1
Reaction score
0
I have a form with 2 data entry fields(dtpicker1,dtpicker2) and a SUBMIT button. When the submit button is clicked, there's a VB procedure that validates and processes the fields. Then that procedure does a "DoCmd.RunMacro "Macro1""

Now, the query called from the macro is supposed to query based on the data
in the form-fields(ie. Dates). However, the query refuses to recognize the fields' existence, and I get prompted for parameters instead. e.g.

Query1 -> select * from emp where doj between frDate and toDate.
here the parameters are frDate and toDate, the same was created as Query parameters to our query1.

Note:
FYI Iam using VB6.0, Ms-access97, ADO2.6, MS-Access 8.0 library
Is there any way to pass these dates to query and run the macro from VB without any obstruction. The database Iam usng is password protected.

you may gone thru such a situation, and threads may posted about that..
Please help me out...
 
Last edited:

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