Multiple queries based off of the same criteria (input)

B

Brett

Hello,

Is it possible to have just one criteria and have it apply to a group
of queries?

I am trying to create a report with the separate results of 4 queries
based on a prompt for the user to input (only once) a date. Is this
something that I program into the report?

Also, this is related but may require a separate posting, but can I do
this with a list box for the user to select a choice, such as
LastMonth, LastWeek, etc.?

Thanks for your help in advance,
Brett
 
J

John W. Vinson

Hello,

Is it possible to have just one criteria and have it apply to a group
of queries?

I am trying to create a report with the separate results of 4 queries
based on a prompt for the user to input (only once) a date. Is this
something that I program into the report?

Also, this is related but may require a separate posting, but can I do
this with a list box for the user to select a choice, such as
LastMonth, LastWeek, etc.?

The same answer will do for both questions: use a Form rather than a prompt.

Create an unbound Form - let's call it frmCrit for convenience - with whatever
controls you need for your queries. If there is a textbox txtDate on the form,
you can use
= Forms!frmCrit!txtDate

as the criterion.

For a listbox, you'll need to get a bit more creative - the listbox would
probably be based on a table and the criterion would use the DateSerial() or
DateAdd() function to generate the criteria, but the specifics would depend
on the exact date ranges that you need to provide and how they should be
interpreted. For example, is "Last Month" the range from April 25 to May 25,
or from April 1 to April 30?
 

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

Similar Threads


Top