Home > Sample chapters > Microsoft Office > Access

Selecting Data Using Queries in Microsoft Access 2013

Prompting to filter data with parameters

If you have a query that you regularly use with different criteria, rather than changing the design of the query each time you want to change the criteria or creating multiple copies of the query with different criteria, you can define a set of parameters so that when you open the query it automatically asks you to enter values for these parameters and then displays the appropriate data.

This type of query can be also used to provide data for a form or report. This means that you can have a report that, when opened, prompts for parameters before displaying the results.

Prompt with query parameters

  1. Click Parameters.

  2. Type a name for the parameter in square brackets. Ensure that the name is different from any column name in your query, or the parameter will not work.

  3. Type a data type for the parameter, and click OK.

  4. Type the parameter name without square brackets. IntelliSense will assist you here.

  5. When you open this query, type a value for the parameter to see the restricted set of results.