Queries can contain Named Parameters, making it easy to reuse a query because the only changes are the data values (for example, in a Where clause).
Named Parameters function like variables. Enter the value for a named parameter once. If it is used in multiple places within the query, the same value is used in all places.
Named Parameters are indicated by a “?” immediately followed by a name. The name can consist of alphanumeric characters plus the “_” symbol.
When an parameterized query is executed, a prompt appears for each parameter before the query is submitted.
For example, if the following query is submitted:
Select * From PhoneBook Where LastName Like '?NameStart'
A prompt appears to enter a value for NameStart.
Parameter values are directly inserted into the query, which means they might need to be enclosed in quotes. Although quotes can be used when prompted for the data value, it is generally recommended to include quotes in the query itself, as in the above example. For more information, see Setting Query Options.