Ask for Criteria.

A

Andy

Hi;

When I was new to Access I use to create multiple queries with different
criteria for multiple reports:
qryItemsOnOrder Criteria >0 rptItemsOnOrder
qryItemsInStock Criteria >0 rptItemsInStock

Learned that can use strCriteria and only one qry and only one rpt
Dim strCriteria As String
strCriteria = "[ItemsOnOrder] > 0"
DoCmd.OpenReport "rptItems", acPreview, , strCriteria
Or
Dim strCriteria As String
strCriteria = "[ItemsInStock] > 0"
DoCmd.OpenReport "rptItems", acPreview, , strCriteria

What I need to learn is how to display a dialog box that asks the user for
the criteria.

What code do I need to add to display a dialog box that asks the user for
the strcriteria and then to use that criteria for the report.
Example:
Dialog box 1: "Enter Begining Date."
Dialob box 2: "Enter Ending Date."
And the report will display only the information in that date range.

Would someone be so kind to steer me in the right direction.

Thank You.

Andy
 

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