Pass Value from One Query to the next

jo15765

Registered User.
Local time
Today, 06:09
Joined
Jun 24, 2011
Messages
130
I have about 20 queries that I run on a daily basis. Currently I have to open each database individually and enter the begin date (monday) and the end date (sunday). My question is, I want to build a form, and write some VB code that would run each query one by one and then display the results for me, but what I can't figure out is how to enter the begin date and the end date, with the 1st query, and have those parameters passed to the subsequent queries.
 
Are these queries parameterised? That is, when you open the query does it pop-up requesting the start and end dates?
 
Yes. When I run the query it asks for the start date then the end date.
 
I noticed in one of your other threads that you said you know DAO, so what I'm about to tell you should be straightforward for you. The QueryDef object has a Parameters method. You can use that to pass your parameters.
 
I am familiar with dao. I will have to play with the query refs objects I think it would be something similar to querydefs(parameter1, parameter2). But I could be totally wrong.
 
Just type QueryDef.Parameters and hit F1. All will be clear.
 

Users who are viewing this thread

Back
Top Bottom