multiple queries with between

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
 
G

Guest

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.
 

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

Top