The biggest frustration with Parameter queries occurs when multiple parameters are required to run the query. The user is confronted with multiple dialog boxes, one for each parameter in the query. The following steps explain how to build a Parameter query that receives its parameter values from a form:
Create a new unbound form.
Add text boxes or other controls to accept the criteria for each parameter added to your query.
Name each control so that you can readily identify the data it contains.
Add a command button to the form and instruct it to call the Parameter query (see Figure 11.41).
Save the form.
Create the query and add the parameters to it. Each parameter should refer to a control on the form (see Figure 11.42).
Right-click the top half of the Query Design grid and select Parameters. Define a data type for each parameter in the Parameters dialog box (see Figure 11.43).
Save and close the query.
Fill in the values on the criteria form and click the command button to execute the query. It should execute successfully.