Prompting for retrieval criteria in a form

You can define your form so that it always prompts you for retrieval criteria just before it retrieves data. In this way, you limit the data retrieved.

StepsTo prompt for retrieval criteria in a form:

  1. Select Design>Prompt for Criteria from the menu bar.

    The Prompt for Criteria dialog box displays, listing all columns in the form:

    Shown is the Prompt for Criteria dialog box. At top is the text "Select column ( s ) to include in criteria dialog." Below this is a scrollable display of all columns in the form, including entries such as employee _ emp _ i d and employee _ manager _ i d.
  2. Select the columns for which you want to specify retrieval criteria when you run the form.

  3. Click OK.

What happens

If you have specified prompting for criteria, InfoMaker displays the Specify Retrieval Criteria dialog box when you run the form—just before the retrieval is done.

Each column you selected in the Prompt for Criteria dialog box displays in the grid. For example, if you selected the State column and the Salary column, you can specify criteria so that only data for employees in Massachusetts with salaries greater than $50,000 is retrieved:

Shown is a sample grid with a column titled employee _ state down arrow and a drop down list box with the state M A selected. A second column titled employee _ salary displays the text entry > 50000. Each column has multiple rows for entries.

You specify criteria exactly as you do in the grid with the Quick Select data source. Criteria specified are added to the WHERE clause for the SQL SELECT statement defined for the form.

Using edit styles

If a column uses a code table or the RadioButton, CheckBox, or DropDownListBox edit style, an arrow displays in the column header, and you can select a value from a drop-down list when you run the form.

Shown is a sample grid. In the left margin, the column headers and next two rows of the grid are labeled Column, Criteria, and Or, respectively. The first column has the header employee _ state down arrow. The second  column is headed employee _ status down arrow and has displays a drop down list with the choices Active, Terminated, and On Leave.

If you do not want the drop-down list used for a column when you specify retrieval criteria, select Properties from the column’s pop-up menu and select the Override Edit check box on the General page in the Properties view:

Shown is a sample general page in the Properties view. At top is an Alignment drop down list bos with the value Left ( 0 ). A Border drop down with the value Lowered ( 5 ), a selected check box for Override Edit, and cleared check boxes for Equality Required and Right To Left.

Forcing the entry of criteria

If you have specified prompting for criteria for a column, you have the option of entering criteria when you run the form. If you want, you can make the entry of criteria a requirement rather than an option. For example, you might have a departmental form that requires the selection of a department.

You can force the entry of criteria for a column by selecting the Equality Required check box on the General page in the Properties view.

When you run the form, InfoMaker underlines the column header in the grid. You must enter criteria for the column. If the column values are presented in a drop-down list, you must pick one. If the column values are numeric, you must use the = operator and not other operators, such as < or >=.

For information about how you can specify selection criteria in the grid, see “Specifying selection criteria”.