Creating a Query Prompt

You can configure a query prompt for print operators to use to enter criterion for a database query at print time. A query prompt can be used as a separate user-input dialog or can be associated with a control on a data entry form.

Query prompts are not supported for database connections that are used by database-related document or form actions or when you open the Database Setup dialog from the List Items property page when the list source type is Database.

ClosedTo create a query prompt

  1. On the File menu, click Database Connection Setup to open the Database Setup dialog. Alternatively, click the icon on the main toolbar. If you have not previously connected to a database, the Database Setup wizard starts. Complete the wizard to display the Database Setup dialog.

  2. In the navigation pane of the Database Setup dialog, click Filter to open the Filter property page.

  3. In the filter design area, click And, and then select the conditional joiner that you want for the filter. For more information about conditional joiners, refer to Conditional Joiners Reference.

  4. Click to create a new filter.

  5. Click the Database Field, and then select the field that you want to determine which records are printed.

  6. Click the Operator, and then select the operator that you want. For more information about conditional operators, refer to Conditional Operators Reference.

  7. Click <enter a value>, and then click New Query Prompt to open the Query Prompts dialog, where you can name your query prompt and configure its properties.

  8. Click OK to close the Query Prompts dialog.

  9. Click Apply Filter, enter your query criterion in the Enter data for query dialog, and then click OK. Your filter is applied, and the results are displayed.

  10. Click OK to close the Database Setup dialog.

You need to specify the query prompt's properties in the Query Prompts dialog only if you do not plan to associate the query prompt with a data entry control on the data entry form. Otherwise, when you associate the query prompt with a data entry control, the options are set by using the control's property pages.

Related Topics