About parameter queries that prompt for criteria (MDB)

Microsoft Office Access 2003

Show All Show All

About parameter queries that prompt for criteria (MDB)

Note  The information in this topic applies only to a Microsoft Access database (.mdb).

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. You can design the query to prompt you for more than one piece of information; for example, you can design it to prompt you for two dates. Microsoft Access can then retrieve all records that fall between those two dates.

Parameter queries are also handy when used as the basis for forms, reports, and data access pages. For example, you can create a monthly earnings report based on a parameter query. When you print the report, Access displays a dialog box asking for the month that you want the report to cover. You enter a month and Access prints the appropriate report.

You can also do the following with parameter queries, forms, and reports:

  • Create a custom form or dialog box that prompts for a query's parameters, instead of using the parameter query's dialog box, and then display the results in a datasheet. For example, you can add buttons and other controls to a custom dialog box.

  • Print the criteria entered in a parameter query for a report in the report header, so you can determine from the report the values used to create it.

  • As an alternative to a parameter query, use a form to enter report criteria, and then show the results in a report.