Immediately after opening the table browser window, records are displayed in the order in which they were added. Such a displaying order will be called sequential. The system permits changing this order, that is, sorting records.
The current order of displaying table records is shown in the status bar of the browser window.
To perform the sorting operation it is necessary to specify sorting condition on the page “Sorting” (figure 24-2) of the property sheet “Properties of query” opened at the command Query+Properties.
Figure 24-2. Page “Sorting” of the property sheet “Properties of query”
The main pane of the property page contains a list of field names. Fields participating in search condition are marked by the arrow sign, the arrow directed upwards means ascending sorting order, downwards – descending order.
The order of fields in the list determines field priority in sorting condition. The higher the position of the field name in the list the higher its priority is. Sorting is performed at first by the field with the highest priority, and then the records having equal values of higher priority field are sorted by fields with lower priorities.
Command buttons Up and Down allow for changing position of the field selected in the list, that is, changing its priority in sorting condition.
Please pay attention to the following: if several fields or one non-indexed field participate in sorting condition, adding records will be impossible, however, changing and removing records is not disabled.
Sorting by one indexed field is performed very quickly due to the presence of an index.
Example. Let's assume that it is necessary to sort the table “List of Building Certificates” by addresses, that is, by street names and building numbers. Sorting condition includes two fields – “Street” and “Building Number”. Priority of the field “Street” is higher than the priority of the field “Building Number”. For each field ascending sorting method should be set up.
For specifying the required order of records it is necessary to perform the following sequence of actions:
open a table browser window for the table “List of Building Certificates” and perform the command Query+Properties; a property sheet “Properties of query” will be opened in which one should select the tab Sorting (figure 24-2);
select the field “Street” in the pane with a list of field names and check the radio button Ascending;
select the field “Building Number” in the pane with a list of field names and check the radio button Ascending;
push the button OK.
It should be noted that since the field name “Street” is before the field name “Building Number” in the field list, rearrangement of fields is not required.
To suppress sorting the radio button Undefined should be checked for the fields included into the sorting condition.