435,294 Members | 2,588 Online
Need help? Post your question and get tips & solutions from a community of 435,294 IT Pros & Developers. It's quick & easy.

# What stands for not selected in a Yes/No field?

 100+ P: 176 Hi. I want to use an Option Group control with 3 values to determine the gender of a person (M/F/Not Selected). The gender of a person is a Yes/No field. Option Group's first value is "-1" for True, "0" is for False. What should I use for not selected? (Null doesn't work) Thanks. Feb 18 '07 #1
7 Replies

 Expert Mod 15k+ P: 31,494 In that case I would use 0 for not selected. 1 & 2 (or even 1 & -1) can be used for the two genders. In a three-way CheckBox the values are Null (not selected); 0 (FALSE); -1 (TRUE); Without the ability to use Null this cannot be a simple CheckBox like entity. Feb 18 '07 #2

 100+ P: 176 In that case I would use 0 for not selected. 1 & 2 (or even 1 & -1) can be used for the two genders. In a three-way CheckBox the values are Null (not selected); 0 (FALSE); -1 (TRUE); Without the ability to use Null this cannot be a simple CheckBox like entity. Well, I have a boolean field for gender, and the values possible for that kind of field are true/false/unchecked, right? In what way I can set 0 for not selected and 1 & 2 for two genders as you said? Is it possible at all to use 3-value option group in order to cause the gender field to be either Yes, No, or Not selected? Feb 19 '07 #3

 Expert Mod 10K+ P: 12,366 A boolean true/false or yes/no field has only 2 options. To relate it to a checkbox, Yes = True = Checked, No = False = Unchecked. Feb 19 '07 #4

 Expert Mod 15k+ P: 31,494 Well, I have a boolean field for gender, and the values possible for that kind of field are true/false/unchecked, right? In what way I can set 0 for not selected and 1 & 2 for two genders as you said? Is it possible at all to use 3-value option group in order to cause the gender field to be either Yes, No, or Not selected? It seems to me you've already tested that and found it to be impossible (post #1). That would have been the solution for you if it had been possible. Firstly then, CheckBoxes can either be boolean fields (TRUE/FALSE) or they can be three-way (TRUE/FALSE/Unset). The idea of a boolean field with three possible settings is contradictory. If an Option Group cannot take a Null value (Post #1) then another value must be assigned specifically in your logic. I think your options are laid out clearly in post #2. Feb 19 '07 #5

 Expert Mod 10K+ P: 12,366 In the end, you'll most likely have to change the field type of gender. You won't be able to use boolean for that field. Feb 19 '07 #6

 100+ P: 176 In the end, you'll most likely have to change the field type of gender. You won't be able to use boolean for that field. Thanks folks, yeah it is contradictroray to have 3 options with boolean. What is the difference then, between an Option Group frame that has 3 values for 3 different possible values of a string field ("M","F","N") and what NeoPa called a 3-way check box? Feb 19 '07 #7

 Expert Mod 15k+ P: 31,494 Not much really. Neither is a boolean object. A 3-way CheckBox can have a value of Null though, which can easily be understood as a special value of unset (Visibly, it is greyed out rather than empty (white) or ticked). Feb 19 '07 #8