Rick is correct, placing the checkboxes in an Option Group frame will do
this automatically. Usually though, checkboxes can be one, none, or all.
Radio buttons are usually used for one or the other. Also, an Option Group
will return a single value for the group. The value will be 1, 2, etc,
depending on the number of objects in the group. The Option Group is then
the control that is bound to the table field, not the individual controls in
the Option Group.
To handle only allowing one checkbox at a time to be checked in code, use
the AfterUpdate event of each checkbox. Use code similar to the following.
Me.chkCheckbox1 = Not Me.chkCheckbox2
This will make the other checkbox value the opposite of the checkbox you
just clicked. In the example above, chkCheckbox2 would be the one you just
clicked. Reverse the 1 and 2 for the other checkbox. This will also force
the other checkbox to be checked if you uncheck a checkbox. If you want to
allow both to be unchecked, but not both checked, then try the following in
each AfterUpdate event:
If Me.chkCheckbox2 Then
Me.chkCheckbox1 = False
End If
Again, reverse the 1 and 2 for the other checkbox. This will force checkbox1
to be unchecked when you check checkbox2, but will do nothing if you uncheck
checkbox 2.
An Option Group will work like the first example.