• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 12. Advanced Query Concepts > Passing Parameter Query Values from a For...

Passing Parameter Query Values from a Form

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:

1.
Create a new unbound form.

2.
Add text boxes or other controls to accept the criteria for each parameter added to your query.

3.
Name each control so that you can readily identify the data it contains.

4.
Add a command button to the form and instruct it to call the Parameter query. (See Figure 12.40.)

Figure 12.40. The command button that calls the Parameter query.


5.
Save the form.

6.
Add the parameters to the query. Each parameter should refer to a control on the form. (See Figure 12.41.)

Figure 12.41. Parameters that refer to controls on a form.


7.
Right-click the top half of the Query Design grid and select Parameters. Define a data type for each parameter in the Query Parameters dialog box. (See Figure 12.42.)

Figure 12.42. The Query Parameters dialog box lets you select the data type for each parameter in the query.


8.
Save and close the query.

9.
Fill in the values on the criteria form and click the command button to execute the query. It should execute successfully.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint