Epi Info™ User Guide

Check Code: Customizing the Data Entry Process

Check Code Commands

Create a Skip Pattern with GOTO

You can create skip patterns by changing the tab order and setting a new cursor sequence in a form, or by creating Check Code using the GOTO command. Skip patterns can also be created based on the answers to questions using an IF/THEN statement. In the following example, we will add check code to move the cursor to the Ethnicity field after data is entered into the DOB field.

  1. From Form Designer, Open the Ecoli.prj project.
  2. Double click on the FoodHistory_NoCheckCode form.
  3. Click Check Code or select Tools > Check Code Editor. The Check Code Editor opens.
  4. From the Choose Field Block for Action section, expand the node for Page 1 to see the various fields on the first page.
  5. Expand the node for the field DOB.
    Choose block for Skip (GoTo) action

    Figure 3.7: Dialog Block for Action after DOB


  6. Double click on the after event.
  7. A block of code for the DOB field will display in the Check Code Editor.
    Check Code sample showing After block shell

    Figure 3.8: Check Code Block for Action After DOB


  8. Click GoTo from the Add Command to Field Block list box. The GOTO dialog box opens.
  9. Select the EthnicityGroup field for the cursor to jump into after data has been entered in the DOB field. The code will run after the cursor leaves the field.
    GoTo command dialog

    Figure 3.9: Skip Pattern Go To dialog box


  10. Click OK. The code appears in the Check Code Editor.
    Check Code sample showing GoTo command

    Figure 3.10: Skip Pattern Check Code Command


  11. Click the Verify Check Code button from the Check Code Editor.
  12. Click the Save button from the Check Code Editor.
  13. Click Close to return to the form.

To test the skip pattern, open the form in the Enter Data tool. Use the tab key to ensure that upon leaving the field with the GOTO command, the cursor goes to the specified field.