multiple queries with between

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

Guest

I have 4 different queries that i want to be exported to excel i know how to
do that with the macro

But

Each query has a between criteria. As it is right now when I run the Macro I
need to enter the date range 4 times, I wanted to if there is a way i can
enter it in once

Also is there is a way that i can just enter the month and year. I not care
about the day by day just the month by month
 
Create a form called frmParameter with two unbound text fields named txtStart
and txtEnd. Also put a button on the form that will run your macro.

In the criteria of the query put the following:
Between [Forms]![frmParameters]![txtStart] and
[Forms]![frmParameters]![txtEnd]

Enter the dates in the appropriate text boxes then press the macro button on
the form. The form must stay open for the queries to work; however, it can be
minimized or even made invisible.
 
Back
Top