Populate only one of 4 fields. Other 3 fields are locked.

J

jsccorps

I have 4 check-box fields that only one should be checked at a time - the
others would not be able to be checked. E.g., a user may check field A -
fields B, C and D are 'locked'. At a later time, user may decide to check
field C - fields A, B and D are locked.

What's the best way to handle this?
 
A

AlCamp

Your question makes no sense... If you select A and then "lock" B C D,
then...
At a later time, user may decide to check field C
But you can't do that... you "locked" BCD when you selected A previously.

I think you'll need to use an OptionGroup where the group may contain 4
choices, but... you can only select one choice at a time. If D is checked
and you later Check A, the D check disappears. Only one choice can be
active at any time.
Check out "Option Group" in Help
hth
Al Camp
 
J

jsccorps

Yeah, 'lock' was the wrong term.

Seems that an Option Group is bound to only one field and each button passes
a different value to the option group.
Currently, I have 4 different controls and each control is bound to a
different field. But, only one of the controls/fields should be populated
/checked at a time (currently, my beta users are checking multiple boxes,
which is causing confusion) Not sure if the Option Group is the right answer.

Is there a standard/off-the shelf solution or is VB coding required?
 
A

AlCamp

I think you may have a table design problem, rather than a "how do I code
this so this happens."
I'd really need to know what the four fields are, what the values might
be (T/F), and what you are trying to accomplish with these 4 fields.

In other words, I'd like to check the "logic" of your table design before
going further.

There may be a whole different... easier... solution to this.
hth
Al Camp
 
A

AlCamp

JS,
I had a second thought... I'd still like to know more about those 4
fields, but... try this in the meantime.
Given 4 fields... A, B, C, and D...
On the AfterUpdate event of A use this code
If A = True Then
B = False
C = False
D = False
End If

On the AfterUpdate event of B use this code
If B = True Then
A = False
C = False
D = False
End If
etc... etc... for all 4 AfterUpdate events.
This won't lock the fields, so you can change your selection at any time,
and you shouldn't ever have 2 selected at once.

hth
Al Camp
 
Top