1-866-245-5224 sales@keystonelearning.com

Access 2003: Single Parameter Queries

Access 2003: Single Parameter Queries

A parameter query is a query that, when run, displays its own dialog box prompting you for information, such as criteria for retrieving records or a value you want to insert in a field.

This means, you can set up a query that prompts you for criteria each time it is run (or, opened).

For instance, entering “[Enter a Customer Name]” in the Criteria box for the Payment field display the following dialog box when the query is run.

Figure 45. Parameter Dialog Box

The beauty of the Parameter Query is that a user won’t have to modify the query design to search the underlying tables for a different set of criteria – they can simply run the criteria again. And, since a query can also be the recordsource for a report, you can create a parameter query that asks a user, before a report is printed, exactly what they want to print.

Creating a Single Parameter Query

     
  1. Open a Select Query in Design view
     
  2.  
  3. In the Criteria row of a field for which you want a parameter applied, type the text that you want the parameter dialog box to display, surrounded by square brackets, for example:
     

[Please Enter a Payment Type]     (Exact Match)

Like [Please Enter a Payment Type]&*    (Close Match)

3.       Run the query several times, entering different values each time to test
(Hint: You can run the query again from Datasheet view by pressing [SHIFT}+[F9])