Article ID: 304352 - Last Review: July 28, 2006 - Revision: 4.0 How to create a parameter query in Access 2002This article was previously published under Q304352 SUMMARY
You can use criteria in a query in Microsoft Access to restrict the set of records that the query returns. To query for different records each time that you run a particular query, you may want the query to prompt you for criteria to enter, for example, "a date from" to "a date to." A query that prompts you for criteria is called a parameter query. This article shows you how to create parameter queries in Microsoft Access. A parameter query displays its own dialog box that prompts you for information. You can design a query to prompt you for one piece of information, for example, a part number, or for more than one piece of information, for example, two dates. Microsoft Access will then retrieve all the records that contain that part number or all the records that fall between those two dates. You can also use parameter queries 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 then Access prints the appropriate report. You can also do the following with parameter queries, forms, and reports:
How to Create a Query with One Parameter
How to Create a Query with Two or More Parameters
How to Create Parameters That Use WildcardsThe following example shows you how to create parameters that use the LIKE operator and the wildcard symbol (*).
REFERENCESFor more information about creating parameter queries, click Microsoft Access Help on the
Help menu, type create a parameter query in the Office Assistant or
the Answer Wizard, and then click Search to view the topics
returned. This information is also available on the World Wide Web at the following Microsoft Web site: create a parameter query
(http://office.microsoft.com/en-us/assistance/HA010550231033.aspx)
For additional information about creating select queries, click the following article number to view the article in the Microsoft Knowledge Base:
304325
(http://support.microsoft.com/kb/304325/
)
How to create a select query in Access 2002
For additional information about creating crosstab queries, click the following article number to view the article in the Microsoft Knowledge Base:
304349
(http://support.microsoft.com/kb/304349/
)
How to create a crosstab query in Access 2002
For additional information about how to convert a select query to an action query, click the following article number to view the article in the Microsoft Knowledge Base:
304354
(http://support.microsoft.com/kb/304354/
)
How to convert a select query to an action query in Access
For additional information about modifying query properties, click the following article number to view the article in the Microsoft Knowledge Base:
304356
(http://support.microsoft.com/kb/304356/
)
How to modify query properties in Microsoft Access
For additional information about using the Like operator in parameter Queries, click the article number below
to view the article in the Microsoft Knowledge Base:
294954
(http://support.microsoft.com/kb/294954/EN-US/
)
ACC2002: How to Use the LIKE Operator in Parameter Queries
For additional information about using forms or custom dialog boxes for parameter queries, click the following article number to view the article in the Microsoft Knowledge Base:
304428
(http://support.microsoft.com/kb/304428/
)
How to use the query by form (QBF) technique
| Article Translations
|
Back to the top
