Microsoft Office Tutorials and References
In Depth Information
3
View the query
results (Figure 2–19).
I
View button
Experiment
Click the View button
to return to Design
view, enter a
different city name, and
view the results.
Repeat this process
with a variety of city
names, including at
least one city name
that is not in the
database.
City fi eld is
not included
in the results
query results
only clients located
in Berridge are
included
Figure 2–19
Creating a Parameter Query
If you wanted to fi nd clients located in Fort Stewart rather than Berridge, you would
either have to create a new query or modify the existing query by replacing Berridge with
Fort Stewart as the criterion. Rather than giving a specifi c criterion when you fi rst create
the query, on occasion, you may want to be able to enter part of the criterion when you
view the query results and then have the appropriate results appear. For example, to include
all the clients located in Berridge, you could enter Berridge as a criterion in the City fi eld.
From that point on, every time you ran the query, only the clients in Berridge would appear.
A better way is to allow the user to enter the city at the time the user wants to view
the results. Thus a user could view the query results, enter Berridge as the city and then
see all the clients in Berridge. Later, the user could use the same query, but enter Fort
Stewart as the city, and then see all the clients in Fort Stewart.
To enable this fl exibility, you create a parameter query , which is a query that
prompts for input whenever it is used. You enter a parameter, rather than a specifi c value, as
the criterion. You create a parameter by enclosing a value in a criterion in square brackets.
It is important that the value in the brackets does not match the name of any fi eld. If you
enter a fi eld name in square brackets, Access assumes you want that particular fi eld and does
not prompt the user for input. For example, you could place [Enter City] as the criterion in
the City fi eld.
Removing a Table
from a Query
If you add the wrong
table to a query or have
an extra table in the
query, you can remove it
by right-clicking the fi eld
list for the table and then
clicking Remove Table on
the shortcut menu.
Search JabSto ::




Custom Search