Epi Info™ User Guide
Check Code
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.
- From Form Designer, Open the Ecoli.prj project.
- Double click on the FoodHistory_NoCheckCode form.
- Click Check Code or select Tools > Check Code Editor. The Check Code Editor opens.
- From the Choose Field Block for Action section, expand the node for Page 1 to see the various fields on the first page.
- Expand the node for the field DOB.
Figure 3.7: Dialog Block for Action after DOB
- Double click on the after event.
- A block of code for the DOB field will display in the Check Code Editor.
Figure 3.8: Check Code Block for Action After DOB
- Click GoTo from the Add Command to Field Block list box. The GOTO dialog box opens.
- 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.
Figure 3.9: Skip Pattern Go To dialog box
- Click OK. The code appears in the Check Code Editor.
Figure 3.10: Skip Pattern Check Code Command
- Click the Verify Check Code button from the Check Code Editor.
- Click the Save button from the Check Code Editor.
- 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.