If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Help running 5 queries with same input criteria
I have 5 queries that I run every month into which I put a start date and an end date. At the moment, I have to run each query separately & must input the same start date and end date in each. I put them into a macro, but it still prompts me for the start date and end date of each. Is there a way that I can input the start date and end date only once & have it pass through as the criteria for all five queries?
Thanks, Lee |
#2
|
|||
|
|||
Help running 5 queries with same input criteria
Use an unbound form with textboxes to enter the dates. Refer the to
textboxes in the queries. Remember the form must be open with data in the boxes. -- KARL DEWEY Build a little - Test a little "Lee S." wrote: I have 5 queries that I run every month into which I put a start date and an end date. At the moment, I have to run each query separately & must input the same start date and end date in each. I put them into a macro, but it still prompts me for the start date and end date of each. Is there a way that I can input the start date and end date only once & have it pass through as the criteria for all five queries? Thanks, Lee -- Lee S. |
#3
|
|||
|
|||
Help running 5 queries with same input criteria
On Wed, 1 Oct 2008 22:24:40 +0100, Lee S.
wrote: I have 5 queries that I run every month into which I put a start date and an end date. At the moment, I have to run each query separately & must input the same start date and end date in each. I put them into a macro, but it still prompts me for the start date and end date of each. Is there a way that I can input the start date and end date only once & have it pass through as the criteria for all five queries? Thanks, Lee A couple of ways. One would be to create a little unbound form, frmCrit, with two textboxes txtStart and txtEnd. In your queries use a criterion such as BETWEEN [Forms]![frmCrit]![txtStart] AND [Forms]![frmCrit]![txtEnd] Put a command button on the form to run a Macro or VBA code which executes all five queries. Or, if the queries always are for (say) the previous month from the time that the query is executed, just put in the date directly: = DateSerial(Year(Date()), Month(Date()) - 1, 1) AND DateSerial(Year(Date()), Month(Date()), 1) or adapt as needed. -- John W. Vinson [MVP] |
#4
|
|||
|
|||
Quote:
A thousand thanks!! |
Thread Tools | |
Display Modes | |
|
|