Create a parameter query

Microsoft Query

Show All Show All

Create a parameter query

  1. Create a query that includes the tables and fields for the records you want.

    How?

  2. Make sure Auto Query Button image is not pressed in.
  3. Make sure Show/Hide Criteria Button image is pressed in to display the Criteria pane.
  4. Click the first cell in the Criteria Field row, and then click the arrow in the cell to select a field from the list that you want to use as the parameter for the query.
  5. Click the first cell in the Value row. Type [ (a left square bracket) followed by the text for the prompt you want Microsoft Query to display when the query is run, and then type ] (a right square bracket). An example is shown in the following illustration.

    Parameter query

    The text of the prompt must be different from the field name, although it can include the field name.

    To create more than one parameter for the query, repeat steps 4 and 5 for each parameter you want to add in the next available column in the Criteria pane.

    For more information about criteria you can use to refine a query, click Button image.

  6. Press ENTER.
  7. To run the query, click Query Now Button image.

Note  When you finish retrieving the data, you can return the result set to Microsoft Excel. For more information, click Button image.