|
|
|
 |
Making groups of Check Box Form Fields mutually exclusive (so that they behave
like radio buttons)
|
Article contributed by Ibby
Select all related Check Box Form Fields, and put them into a Frame by
clicking the Insert Frame button on the Forms toolbar:
The checkboxes can't be in a table, because Frames can't be in a table. The
Frame you insert will initially have its Text wrapping set to Around, but you will probably find it behaves better if you
change this by selecting the Frame, then selecting Format + Frame, and
changing the Text wrapping to None. The frame will then
flow with the text. By default there will be a box border around the text, but
you can change the border (or remove it), by selecting the text within the
frame, and then selecting Format + Borders and Shading.
If you do want a border, you can change its dimensions by dragging the
edge handles of the frame: 
Now
assign the following code as the Entry macro for all of the checkboxes, and
protect the form. The Check Box Form Fields in each Frame will then be mutually
exclusive. Sub MakeCheckBoxesExclusive()
Dim oField As FormField
For Each oField In
Selection.Frames(1).Range.FormFields
oField.CheckBox.Value = False
Next oField
Selection.FormFields(1).CheckBox.Value = True
End Sub There is one minor but unfortunate
drawback to doing this; if the user tabs or uses their keyboard arrow keys to go
from one form field to the next, each checkbox form field will become selected,
in turn, as they reach it (and the others will be deselected); so
they have to use the mouse, not the keyboard, to select the checkboxes .
|