Results 1 to 4 of 4
  1. #1
    sharonir22 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    16

    Option group radio buttons

    hi
    I've set an option group on my form with yes/no option, Yes being the default option. for some reason, when the form is displayed, the radio button of the default option appears unchosen (not blue)
    has anyone seen this problem before? I would appreciate a solution

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    In older versions of Access all of this was managed via the properties of the option group. I have not tried building any in 2013 yet. Have you tried using a MsgBox in the form's on load event to see what the default value is?

    The option group default value is not the same as the default value of a radio button. Use your cursor to select the outside edge of your option group before checking the properties and also, check the name of your option group.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    As ItsMe posted, you have to control this through the Option Group, not using the individual Radio Buttons. If you used the Option Group Wizard to create the OG, it asked you to enter a Label for each selection. If you entered them as

    Yes
    No


    in that order, then when Yes is ticked, the OG's Value is 1, when No is ticked, the OG's Value is 2.

    To set the Default for the OG to 'No,' as you need to, you need to enter 2 as the Default.

    1. Right Click on the OG's Frame, which, unless you changed its name, will be something like FrameX, where X is a number
    2. Click on Properties
    3. Click on Data Tab
    4. Set the Default Property to 2

    If you assigned the selections in reverse, to

    No
    Yes


    instead of

    Yes
    No


    as given above, you need to set the Default, in the Property Pane to 1, instead of 2.

    When you refer, in VBA code, to the selection made in the OG, you'd use code something like this

    Code:
    Select Case Me.FrameX
    
     Case 1
    
      'What to do if the first control was selected
    
     Case 2
    
      'What to do if the second control was selected 
    
    End Select

    Linq ;0)>

  4. #4
    sharonir22 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    May 2015
    Posts
    16
    So after investigating I noticed the 1 value is being stored in the table as -1. So i changed the button value to -1. Worked for me.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 06-26-2014, 03:10 AM
  2. Replies: 6
    Last Post: 12-04-2013, 07:00 PM
  3. Replies: 4
    Last Post: 07-08-2013, 03:46 PM
  4. Radio buttons within Option Group not working
    By losingmymind in forum Programming
    Replies: 7
    Last Post: 01-09-2013, 03:09 PM
  5. option group radio buttons
    By ManC in forum Forms
    Replies: 9
    Last Post: 03-08-2010, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums