Primary Criteria in Query Forms

On the Primary Criteria tab of a query form, you can specify query criteria for the principal fields on the associated multiview form. Usually these fields represent only the two or three most commonly searched criteria for the form. For example, in a form used to maintain information about customers, primary fields might include customer identification number and customer name.

The same fields are also listed on the Additional Criteria tab. This means that query criteria for the principal fields can be specified on either tab.

Primary criteria consist of an operator for the selected field on which you want to filter data and a value for the field. By default, the comparison operator for all primary criteria is like, and the values are empty. With these settings, all records are considered a match. The result set is the same as the result set from executing Filter-in-Place when no values are entered in fields on the form.

Primary criteria are automatically joined by a Boolean AND. That is, records are retrieved from the database only if they meet all the specified criteria.

Example:

Suppose that you own a company that deals primarily with bicycle retailers. You want to retrieve all records that contain bi in the Name field, so that you will get a collection displaying all records that contain either "bike" or "bicycle."  Specify this expression in the Primary Criteria tab:

Name LIKE *bi*

Where Name is a field listed on the Primary Criteria tab, LIKE is the operator you selected, and *bi* is the value you specified.

The value *bi* restricts the results to those records containing "bi" in the Name field. The wildcard character (*) matches all other possible combinations of characters that come either before or after the search value "bi". The query might return records containing "Bicycle Center" and "Terry's Bike Shop" in the Name field. Remember that the value you specifiy here is not case-sensitive.

Related topics