The information in this article applies to:
Advanced: Requires expert coding, interoperability, and multiuser skills. SUMMARYAn easy way to prompt a user for a search criteria in a query is to create a parameter query. However, to use a parameter in a union query, you must follow some specific rules. This article uses the Customers and Suppliers By City query in the sample database Northwind.mdb to describe how to add a parameter to a union query. MORE INFORMATIONThe Customers and Suppliers By City union query selects records from both the Customers and Suppliers tables. The SQL of this query is as follows:
To add a parameter to the union query, you must duplicate the parameter in
each SELECT clause in the query. To add a parameter (in this case a city)
to the query, follow these steps.
CAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.
REFERENCESFor more information about union queries, click Microsoft Access Help on the
Help menu, type "union queries" in the Office Assistant or the Answer Wizard,
and then click Search to view the topics returned. Additional query words:
Keywords : kbusage kbdta QryUnion |
Last Reviewed: May 13, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |