General discussion

  • Creator
    Topic
  • #2083489

    VB: Options Buttons & a Default Value

    Locked

    by lgreenbe ·

    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.

All Comments

  • Author
    Replies
    • #3770546

      VB: Options Buttons & a Default Value

      by tclere ·

      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.

    • #3771292

      VB: Options Buttons & a Default Value

      by ramesh vishnubhatla ·

      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.

    • #3787905

      VB: Options Buttons & a Default Value

      by trishs ·

      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.

    • #3776021

      VB: Options Buttons & a Default Value

      by donq ·

      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?

    • #3769495

      VB: Options Buttons & a Default Value

      by kellyl ·

      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.

    • #3769482

      VB: Options Buttons & a Default Value

      by lgreenbe ·

      In reply to VB: Options Buttons & a Default Value

      This question was closed by the author

Viewing 5 reply threads