Prompting for retrieval criteria in a DataWindow object

You can define your DataWindow object so that it always prompts for retrieval criteria just before it retrieves data.

StepsTo prompt for retrieval criteria in a DataWindow object:

  1. If the Column Specifications view is not already displayed, select View>DataWindow Painter Layout>Column Specifications from the menu bar.

  2. Select the Prompt check box next to each column for which you want to specify retrieval criteria at runtime.

When you specify prompting for criteria, DataWindow Designer displays the Specify Retrieval dialog box just before a retrieval is to be done.

Each column you selected in the Column Specification view displays in the grid. Users can specify criteria here exactly as in the grid in the Quick Select dialog box. Criteria specified here are added to the WHERE clause for the SQL SELECT statement defined for the DataWindow object.

NoteTesting in DataWindow Designer You can test the prompting for criteria by retrieving data in the Preview view of the DataWindow object.

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 users can select a value from a drop-down list when specifying criteria:

The sample shows the Specify Retrieval Criteria dialog box that a user sees just before a retrieval is done. The  column is dept _ i d and under it is the Criteria field showing the value 100 with an arrow to the right for the drop down list.

If you do not want the drop-down list used for a column for specifying retrieval criteria to display, set the CriteriaOverrideEdit property in the Behavior category in the column's Properties window.

Forcing the entry of criteria

If you have specified prompting for criteria for a column, you can force the entry of criteria for the column by setting CriteriaRequired to True in the Behavior category of the column's Properties window. DataWindow Designer underlines the column header in the grid during prompting. Selection criteria for the specified column must be entered, and the = operator must be used.

For more information

The section “Using Quick Select” describes in detail how you and your users can specify selection criteria in the grid.

The chapter on dynamic DataWindow objects in the Programmer’s Guide describes how to write code to allow users to specify retrieval criteria at runtime.