Create a parameter query that prompts for criteria each time it's run

Create a parameter query that prompts for criteria each time it's run

A parameter query displays one or more predefined dialog boxes that prompt you for the parameter value (criteria). You can also create a custom dialog box that prompts for the query's parameters. For more information, click .

  1. Create a select or crosstab query.

  2. In query Design view, drag the fields from the field list to the query design grid.

  3. In the Criteria cell for each field you want to use as a parameter, type a prompt enclosed in square brackets. Microsoft Access will display this prompt when the query is run. The text of the prompt must be different from the field name, although it can include the field name.

    Text in Criteria cell appears as prompt when the query runs

    For a field that displays dates, you can display the prompts "Type the beginning date:" and "Type the ending date:" to specify a range of values. In the field's Criteria cell, type Between [Type the beginning date:] And [Type the ending date:].

  4. To view the results, click View on the toolbar, and then type a value for the parameter. To return to query Design view, click View on the toolbar again.

Notes