 |
| Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

May 7th, 2004, 02:41 PM
|
|
Authorized User
|
|
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
How to deselect "Option Group" box?
Hi All:
I want to creat an option group control in Access form, for example male and female, so when someone enter the data, she can just select the value instead of type the value. But if she want to deselect, means leave it blank. How to do it?
thanks
cindy
|
|

May 7th, 2004, 07:01 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
does it make sense to leave it blank?
-Vijay G
|
|

May 8th, 2004, 09:31 AM
|
|
Authorized User
|
|
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sometimes the original form is blank.
|
|

May 8th, 2004, 11:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Check for its properties, I am not sure if that is CHECKED or ENABLED
It should be
optionbuttonName.Enabled = FALSE
OR
optionbuttonName.Checked = FALSE
This should do the trick. But you got to put a button kind of thing to do that. Call it as DESELECT, on click of that button, you should make its ENABLED/CHECKED property as FALSE.
Hope that helps in some way.
Cheers!
-Vijay G
|
|

May 10th, 2004, 03:55 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Actually, you cannot DEselect an option group. By definition, an option group is ALWAYS set to SOMETHING. That's why when you create one, it assumes the DEFAULT OPTION is the first one unless you specify otherwise. What you can do for those situations when someone leaves something out is to put, using your male/female example, a third option. You can label it "unspecified" and set THAT to be the default.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|
|

May 10th, 2004, 06:48 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I agree with Greg's "option" of having an "unspecified".
Say, for example, the original form was blank, you should definitely have an "unspecified" option, as this will let you know that it was the original form that was blank, not that the person entering the data on the database was lazy, or just forgot to put in that question.
This way, you'd really have 4 options, eg:
1 = Male
2 = Female
-1 = unspecified
Null = data entry not done properly
Steven
I am a loud man with a very large hat. This means I am in charge
|
|

May 11th, 2004, 06:46 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
|
|
Quote:
quote:Originally posted by Steven
This way, you'd really have 4 options, eg:
1 = Male
2 = Female
-1 = unspecified
Null = data entry not done properly
|
Actually, Steven, with an option group, you wouldn't have a choice. They'd be numbered 1, 2, 3, 4. It would never be equal to -1 or null.
Which order you'd want them is up to you, of course.
Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
|
|
 |