Share this Page URL
Help

Chapter 10. Presenting Data with Reports > Using a Parameter in Report Criteria - Pg. 357

Presenting Data with Reports 357 12. Close the ProductsByCountry report, saving the changes you made. Following the approach described in the section "Using a Control's Value in Query and Filter Criteria" in Chapter 8, you could create a criteria expression for the ProductsByCountry report that referred to a control on a form. Criteria would be defined by the value in the control. In Chapter 13, "Completing Your Database Application," we'll create a report switchboard form that implements this approach for several reports in the HelloWorld database. Just the Steps Filter records in a report 1. 2. 3. 4. 1. 2. 3. 4. 5. 6. 7. 8. In the Database window, select the report, and then click Design. Click the Properties button on the toolbar to open the Properties dialog box. On the Data tab, click in the Filter property box, and enter the expression that selects the records you want to see--for example, [OrderDate] Between #1/1/2004# and #6/30/2004#. Click in the Filter On property box, and set the property to Yes. In the Database window, select the report, and then click Design. Click the Properties button on the toolbar to open the Properties dialog box. Select Report from the list at the top of the Properties dialog box if Report isn't already displayed. On the Data tab, click in the Record Source property box, and then click the Build button. In the Query Builder window, enter a parameter prompt in the Criteria row for the field for which you're creating a parameter--for example, [Enter a company name] . On the Query menu, click Parameters. In the Query Parameters dialog box, enter the query prompt, select the data type for the parameter's field, and then click OK. Close the Query Builder window, and then click Yes to update the report's record source. Open the report in the Preview window, and then enter a value in the parameter input box that Access displays. Create a parameter for a report