Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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
 
Old May 7th, 2004, 02:41 PM
Authorized User
 
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

 
Old May 7th, 2004, 07:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

does it make sense to leave it blank?

-Vijay G
 
Old May 8th, 2004, 09:31 AM
Authorized User
 
Join Date: Apr 2004
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sometimes the original form is blank.

 
Old May 8th, 2004, 11:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

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
 
Old May 10th, 2004, 03:55 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

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
 
Old May 10th, 2004, 06:48 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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
 
Old May 11th, 2004, 06:46 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

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





Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
Option Group Variables (from Form to Module) emanuele.musa VB How-To 1 July 20th, 2007 03:58 PM
Hide Subform Using Option Group martinaccess Access 1 October 3rd, 2004 10:48 AM
Option group vnadig Access 6 September 8th, 2004 02:53 PM
Option Group Procedures Mr.Crud Access VBA 7 February 12th, 2004 06:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.