|
Now you have created a query that retrieves the data from a
specific set of fields, but suppose that you want to see only the data within a
field that meets a set of criteria. For example, you want to see the records in
the census database grouped by the neighborhood where people live. A parameter
query lets you set the criteria for your query when you run it.
You can add a parameter to an
existing query, or create a parameter query in Design view. You add a parameter
by entering a prompt in the criteria box of the field for which you want to set
parameters. You must enclose the prompt in square brackets.
CREATE A PARAMETER QUERY
1.
Open the query to which you want to add a parameter by clicking it in
the database window and then clicking
Design
in the upper-left corner of the window.
2.
Click
the
Criteria
text box
of the field you want to set a parameter for and then type the prompt that will
appear when you run the query. Remember to enclose the prompt in square
brackets [ ].
3.
Save the query with the added parameter and then close it.

RUN A PARAMETER QUERY
1.
With the query open in Design
view, click
Run
on the
Query Design toolbar.
Before your datasheet appears, Access 2000 displays a dialog box
prompting you to enter the criteria you are interested in.
2.
Enter the
value and then click
OK.
The datasheet opens showing only the specific information you have requested.

You have learned just two of
many types of queries you can create and run in Access 2000. You can use
mathematical expressions to perform calculations on your data or you can use
aggregate functions, such as
Avg
or
Sum, to
calculate statistical information. To learn how to create other queries, ask
the Office Assistant.
|