Setting criteria from a form to run a Query

robbie9

Registered User.
Local time
Today, 07:38
Joined
Feb 11, 2001
Messages
17
I want to open a form and fill in a few check boxes..Then hit a button to print out a report based on the criteria I checked off.. For example.. I want to print out who we have quoted in the past week in New Jersey.. I can make a query and run it, and it works fine.. But I want to make it simple so our salesmen can just open a form, check a few boxes and hit print..

Can anyone point me in the right direction??
 
Under the Help menu check out:

reports, criteria to select data to include then

Use a form to enter report criteria

Write back if you have additional ??
 
I often use queries based on information in forms.

For example, if I want to find all orders for a particular state between two dates, the user would fill in the appropriate information on the form. (probably using a combo box to select the state so spelling won't be an issue). Lets say the names of these text boxes are State, StartDate, & EndDate and the form is called StateSalesForm.

When I set up the query in the design view grid, I set up the criteria based on what is on the form. So the criteria for state field would be [forms]![StateSalesForm]![State]. The criteria for the Date field would be Between [forms]![StateSalesForm]![StartDate] AND [forms]![StateSalesForm]![EndDate].

On the form, after the user fills out the form, have him click a button that runs an event procedure that will check to make sure the form is all filled in, check to see if the end date is really after the start date, then run the query, and call up the report.

Hope this helps a little.
 

Users who are viewing this thread

Back
Top Bottom