The ACheckbox control allows the user to select a checkbox and toggle its state from checked to unchecked, or from unchecked to checked. ACheckbox can be used to represent Yes/No or True/False options. Each checkbox can be checked or unchecked independently of any other checkbox. If you want to establish a choice among different options, you would be better off using ARadioButton.
At design time, you can set a number of properties for the ACheckbox control. Most importantly, you can set the initial state of the checkbox: whether its initial value is checked, unchecked, or, if you want the checkbox to be disabled because it is inappropriate in a given context, grayed out.
In this example, frmCheckboxes is a form variable representing a form called CheckboxForm. You can see that chk1 and chk3 can be changed even after their values have been set. In the example, we lock chk2 by disabling it, so that its value cannot be changed. (A useful extension of this example might be to use the OnChange() event to change other checkboxes once a particular one has been selected).
load frmCheckboxes
print "Checkbox 1 value "; "\t";frmCheckboxes.chk1.value
! chk1, chk2, and chk3 have all been made Public
frmCheckboxes.chk1.value = 1 ! set Checkbox1 to checked
frmCheckboxes.chk2.value = 2 ! set Checkbox2 to grayed-out
frmCheckboxes.chk3.value = 0 ! set Checkbox3 to unchecked
frmCheckboxes.chk2.Enabled = 0 ! prevent grayed-out Checkbox2 from being changed.
unload frmCheckboxes