Epi Info™ User Guide

Command Reference


Check Commands: Click and End-Click

Description
This command executes a block of Check Code commands when you click a field or select a value in one of the supported fields.   Not all field types support the Click / End-Click command block.  Supported field types are Codes, Command Button, Comment Legal, Legal Value, Option, and Relate.  Unlike the Before and After command blocks, the Click command block is only applicable to the those supported field types and is not applicable to the form, record, or page.

Syntax
Click

//add code here

End-Click

  • Click and End-Click are only used in Check Code and only with the supported field types.

Comments
The Click command determines when commands are run.  Commands between Click and End-Click run when you click one of the supported fields or use the mouse to make a selection on a supported drop-down list.  If a field is Read-Only, Disabled, or Hidden, the Click command block will not run because these properties prevent you from clicking the field.

Example
The following commands demonstrate the Click / End-Click command block.  When the checkbox for “ConsumedRawShellfish” is clicked, determine the value of the checkbox and, if checked (+), then enable the ShellfishType group box.  On the other hand, if the checkbox is clicked to uncheck the box, then disable the ShellfishType group box.

Field ConsumedRawShellfish
   Click
      IF ConsumedRawShellfish = (+) THEN
          ENABLE ShellfishType
      ELSE
          DISABLE ShellfishType
      END-IF
   End-Click
End-Field

Note: Checkbox fields are evaluated as True (checked) or False (unchecked).  When writing Check Code, use (+) and (–) to indicate checked and not checked, respectively.  For more information about how to use a Checkbox on your form, see the Form Designer section describing the Checkbox field.