FCAS allows the creation of field arrays, which let you perform operations on groups of similar types of fields using an indexing method, rather than explicitly referencing a unique name for each field.
Field arrays are particularly useful when assigning properties to large groups of controls.
To create a field array, open the form you want to work with in FCAS and assign a name to a field. Then assign the same name to a field of the same type on this form. You will then be prompted to create a field array. The field will be assigned an index that will be visible in the Attributes window. Assigning the same name to additional fields of the same type on this form will include them in the field array.
After all the desired fields have been added to the field array, you can reference each field by its identifier in conjunction with its index.
As an example, this code will protect 100 checkboxes:
Dim i As integer
For i = 0 to 99
cboMyCheckBoxArray(i).Protected = TRUE
Next
|