Access 2003 Rookie Question

K

knowshowrosegrows

I want to create a button on a form that will ask me to specifiy a date range
and then apply that date range to two seperate queries and give me both
results.

How do I begin to think about this?
 
J

Jeff Boyce

Start with a form that has two text controls. Use the labels to indicate
which will hold a start date, and which will hold an end date.

Create a query that returns data you want to see. Since you are describing
a "date range", one of the fields of data available must be a date field.
Use parameters in the Selection/criterion "cell" under that date field.
Your parameters will look something like:

Between Forms!YourForm!txtYourStart And Forms!YourForm!txtYourEnd

NOTE -- this approach will only work if the form is open, and the controls
have date values.

One more step -- in design view of the form, add a command button that opens
the query.

When you have this much working, work on the second query using the same
approach. Rather than add a second command button, consider adding the code
that opens the second query to the first command button.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Top