Defining Access Orders

You can define up to five indexes or access orders for a form. An access order tells the program the sequence in which to display data on the form.

When a form has more than one access order, you must assign a single alphanumeric value to each access order and choose one access order as the default. You must also paint an Order field on forms with multiple access orders. For more information, see the Order field description in Painting Fields on a Form - Input Field Types.

When you run the form, you type the value associated with the desired access order in the Order field. This tells the form which access order to use when displaying the data. If you do not type a value in the Order field, the form uses the default access order.

In the following example, Employee is the primary file. The form has three access orders. The first access order is by Company and Last Name, the second is by Company and Employee Number, and the third is by Company and Social Security Number. The Order field is called Search Order.

You can mark one or more access order key fields as "required for Next" action. When you use the N action to scroll through the records of a file, and the value of one of these marked keys changes, the form stops scrolling. If you do not mark any key fields as "required for Next," the form stops scrolling on the last record in the file.

In the following example, the key fields are Company and Employee Number. If you mark Company as "required for Next," the N action scrolls only through the Employee file records whose Company is 1. If you do not mark any keys "required for Next," the N action scrolls through all records in the Employee file regardless of their company number.

To define an access order

  1. On the Format form, press Define (F6) and choose Orders.
    In this field Type or Select (F4)
    Value The alphanumeric value used to invoke the access order.
    Name Optional. A description of the order.
  2. To add an access order, press Insert (F8) or press Enter.

    To change an access order, select the Index field whose value you want to change and press Select (F4).

  3. In the FileName Indexes window, select an index.

    The key fields for the selected index appear in the Key Order window. If the index has a condition, it appears next to the Key Order window. After you select an index, it appears in the Access Orders window.

  4. To define the key fields required for the N (Next) action, press Define (F6) and choose Next Keys.

    In the Next Event Required Keys window, select the required key fields. The default is None.

  5. If the form has more than one access order, you must choose a default order. Select the desired default order, press Define (F6) and choose Default Value.

    In the Order Values window, select the order you want as the default order.

    The word "Default:" followed by the order you selected appears in the upper left of the Access Orders window.

  6. Press OK twice.