Option Group

  • Thread starter Thread starter LH
  • Start date Start date
L

LH

I've got 3 fields that I need to represent each as Yes, No
or Neither. This is to make sure the user either selects
the required "Yes" or "No" or hasn't made a selection.
The database fields are Bit (SqlServer) datatypes and
nulls are allowed. I created 3 option groups, one group
for each field. The Option Group "Yes" value is set to -1
and the "No" value is set to 0.
When the screen is first dislayed, neither Yes or No is
selected and each of the buttons are shown in a greyed
state which is what I want when the database value is
Null. However, as soon as any other field on this form is
modified or a selection is made to any one of the Option
groups all the option groups become un-greyed and the "No"
Option is shown as selected. Even though the database
value remains Null for these fields, it appears to the
user that the "No" option is selected and that he is not
required to make a choice, and as a matter of fact,
because the No appears as selected, "No" cannot be
selected.
Is this the normal behavior for Option Groups? Is there a
way to get the functionality I need? Any halp would be
appreciated. Thanks!
 
LH said:
I've got 3 fields that I need to represent each as Yes, No
or Neither. This is to make sure the user either selects
the required "Yes" or "No" or hasn't made a selection.
The database fields are Bit (SqlServer) datatypes and
nulls are allowed. I created 3 option groups, one group
for each field. The Option Group "Yes" value is set to -1
and the "No" value is set to 0.
When the screen is first dislayed, neither Yes or No is
selected and each of the buttons are shown in a greyed
state which is what I want when the database value is
Null. However, as soon as any other field on this form is
modified or a selection is made to any one of the Option
groups all the option groups become un-greyed and the "No"
Option is shown as selected. Even though the database
value remains Null for these fields, it appears to the
user that the "No" option is selected and that he is not
required to make a choice, and as a matter of fact,
because the No appears as selected, "No" cannot be
selected.
Is this the normal behavior for Option Groups? Is there a
way to get the functionality I need? Any halp would be
appreciated. Thanks!

Seems to me you only need one field and one OptionGroup. Just store three different
integer values depending on which option is selected.
 
Try Setting the TripleState Property to true. When this value is false
check boxes display the behavious you describe.

Ron W
 
LH said:
No Rick, I need 3 option groups. This is for Yes/No/Null
states for 3 different fields (Each one of the 3 can be
yes/no/null).

While SQL Server now supports Null on bit fields I don't think Access does.
Switching to an integer field would solve the problem.
 
Oooopppsss....

I misread your post. I was thinking CheckBox Not OptionGroup. The
TripleState Property is available on checkboxes not on the Option Group.
Sorry :-(

I Agree with the solution that Rick proposes. Change the field to a
smallint or a char(1) and pick three values to store there like
1, 2, 3
or
T, F, [Null]
or
Y, N, [Null]

Using a char(1) field makes the raw underlying data more readable

Ron W
 
Back
Top