How query mode works

Once the DataWindow is in query mode, users can specify selection criteria using query by example—just as you do when you use Quick Select to define a data source. When criteria have been defined, they are added to the WHERE clause of the SELECT statement the next time data is retrieved.

The following three figures show what happens when query mode is used.

First, data is retrieved into the DataWindow. There are 36 rows:

The image shows columns with the sales rep’s last name with the quarter, product name, and units sold.

Next, query mode is turned on. The retrieved data disappears and users are presented with empty rows where they can specify selection criteria. Here the user wants to retrieve rows where Quarter = Q2 and Units > 10:

The image shows Q1 in the Quarter column and the greater than sign followed by 15 in the units column.

Next, query mode is turned off and Retrieve is called. The DataWindowControl adds the criteria to the SELECT statement, retrieves the seven rows that meet the criteria, and displays them to the user:

The image shows the columns where the units sold exceed 15

You can turn query mode back on, allow the user to revise the selection criteria, and retrieve again.