| Including Parameter Values in a Report | | | | Ivan Jones |
| This exercise is for Access users who have some | | | | London |
| experience with parameter queries and creating their | | | | Close the table |
| own reports. A parameter prompts the end user to | | | | 2. Create a query based on this table, adding all the |
| enter criteria each time the query is run. This exercise | | | | fields to the query grid. Then add the following |
| shows you how to display the parameter value that is | | | | parameter for the Location field. |
| given by the end user in the heading of a report based | | | | [Which location?] |
| on the query. | | | | Then in the next available column in the query grid type |
| There are three main steps we need to complete to | | | | the following into the Field row |
| demonstrate this: | | | | ParaLoc:[Which location?] |
| 1) Create a table | | | | ParaLoc is just the name we have given our new |
| 2) Create a parameter query based on the table | | | | column – it’s not a special function or anything |
| 3) Create a report based on the query | | | | like that. If you are experienced user of parameter |
| 1. Create a new table and save it as tblEmployees. | | | | queries you may wonder we have created this |
| The table will need to hold the following fields which | | | | column. Well essentially it is so we can store the |
| you should create in design view: | | | | parameter value in a field and then refer to that field in |
| Field Name Data Type | | | | the report. |
| EmployeeID AutoNumber | | | | Save the query as qryLocation and close it. |
| FirstName Text | | | | 3. Create a report based on this query using the |
| LastName Text | | | | Report Wizard. Use all the fields except maybe the |
| Location Text | | | | EmployeeID field. Once the report has been created |
| Set Employee ID as the primary key | | | | switch to design view and in the report header delete |
| Enter the following records into this table | | | | the current report heading including its box. |
| EmployeeID FirstName LastName Location | | | | Open the form toolbox and draw a text box where |
| 1 Andy | | | | the report heading used to be. Delete the label for |
| Bean London | | | | the text box and then type the following into the text |
| 2 | | | | box: |
| Claire Doubt London | | | | =“Employees Report for&“ |
| 3 | | | | ”&[What Location?] |
| Enid Fairview Brighton | | | | Print preview the report: the parameter value that |
| 4 Geoff | | | | you entered for the location should appear in the |
| Hall Brighton | | | | heading of the report. |
| 5 | | | | |