General discussion
-
CreatorTopic
-
August 15, 2000 at 2:08 am #2083489
VB: Options Buttons & a Default Value
Lockedby lgreenbe · about 24 years, 7 months ago
How do I create a group of option buttons (radio buttons) and prevent them from appearing which one option already selected?(e.g. a default selection)
When I set all the value properties to false, the first option button shows up as selected.
Topic is locked -
CreatorTopic
All Comments
-
AuthorReplies
-
-
August 16, 2000 at 12:59 am #3770546
VB: Options Buttons & a Default Value
by tclere · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Make sure that you do not use the SetFocus method, which will activate the option. Try it on a blank form, setting all of the value properties to false will deactivate all selections. You may have some other code that is causing this to happen.
-
August 25, 2000 at 1:57 am #3769483
VB: Options Buttons & a Default Value
by lgreenbe · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Poster rated this answer
-
-
August 17, 2000 at 9:27 am #3771292
VB: Options Buttons & a Default Value
by ramesh vishnubhatla · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Usually Option buttons are used when the answers to a question is from a pre-defined list. So, one of them has to be selected. If you want to handle a situation when none of the options is valid, then you may try these two things:
- Have another option button with a caption “No Selection” or something like that.
- Have a Check box, which when checked will enable a frame containing the option buttons and when unchecked diables the frame. In the code, you can check for thevalue of the Check box before proceeding to evaluate the value of an option button.
Hope this answer helps.
-
August 25, 2000 at 1:57 am #3769484
VB: Options Buttons & a Default Value
by lgreenbe · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Poster rated this answer
-
August 20, 2000 at 6:12 am #3787905
VB: Options Buttons & a Default Value
by trishs · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
It could be that the option group is the first item in the TabIndex – when the form loads, it receives the focus and the first option gets selected. Set the TabIndex of something else to 0, and you should have no problems.
-
August 25, 2000 at 1:57 am #3769485
VB: Options Buttons & a Default Value
by lgreenbe · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Poster rated this answer
-
-
August 22, 2000 at 6:43 am #3776021
VB: Options Buttons & a Default Value
by donq · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
If your Option Group is linked with a Field within a Table make sure its Default Value is Null, When you create an Option Group you are allowed to create one where one of yout pre-defined values is used as a “Default”, or select the No Nefault Option which should open the entire group (for a new record) whit every button greyyed. When the Form indexes to a selected record (where an attached field is linked to the group) the selected option should change from record to record. When I use the Wizard to create the Group (and mess up) I just delete it and start over – it only takes a minute?
-
August 25, 2000 at 1:57 am #3769486
VB: Options Buttons & a Default Value
by lgreenbe · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Poster rated this answer
-
-
August 25, 2000 at 1:41 am #3769495
VB: Options Buttons & a Default Value
by kellyl · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Create an extra option button and set its value to True. Then using the properties page “move” this button to where it is not visiable in the group box. You may then check its value in code to see if the user has selected an option.
-
August 25, 2000 at 1:57 am #3769487
VB: Options Buttons & a Default Value
by lgreenbe · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
Poster rated this answer
-
-
August 25, 2000 at 1:57 am #3769482
VB: Options Buttons & a Default Value
by lgreenbe · about 24 years, 7 months ago
In reply to VB: Options Buttons & a Default Value
This question was closed by the author
-
-
AuthorReplies