Exercise 7.8: Switching between multiple records

Before you begin, you must complete Exercise 7.7: Adding fields to the subfile record.

Now let's fix up the Subfile control record. The group you created contains 2 records. You can verify this by looking at the record list in the toolbar:
Record list

  1. Change the current record by selecting RECORD1CTL from the record list or click next record next record button or press Alt+End.

    The fields in the subfile still appear so that column heading can be lined up, but they appear at half-intensity so that they can be distinguished from the fields of the current record.
    half intensity

  2. Rename the record to EMPLSTCTL using the toolbar. Let's provide a 'Position to' entry in the subfile control header.
  3. Position the cursor at 4, 9 and type:
     Position to:
    

    Add position to field

    Now you need an employee name field.

    You could create a named field with the right characteristics like you did in the subfile, or you could create a source reference using the Create source reference field Source Reference button button in the palette, or you could reference the original database field using either the Create database reference field button or the Create database reference field button Create database reference field(s) by selection Create database reference field(s) by selection button button. But there is an even simpler way. Use copy and paste!

Copying the employee name field

To copy the employee name field:

  1. In the DDS tree expand the EMPMNT record.
  2. Click the ENAME field and press Ctrl+C.
    Locate EMPMNT then ENAME
    (The pop-up menu or Edit menu shows the Copy menu item as well).
  3. Position the cursor to 4, 23 and press Ctrl+V. Now that was easy!
  4. Click the field and change the name from ENAME to POS_TO.
    Rename field to POS_TO

You have fixed up the subfile records to add an employee name field with a position to entry opposite this field and you are ready to begin Exercise 7.9: Adding field error handling.