Results 1 to 8 of 8
  1. #1
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18

    Radio buttons within Option Group not working

    Can someone please help? I have a form bound to a table. On that form I have an unbound Option Group with 20 radio buttons. I have figured out how to translate the number value to text on the table but now everytime I update a record using the form the button doesn't stay selected. For example; I choose button one and the proper text goes to the table. I go to the next record and select button number 2 and that information is also correctly translated to the table. But, when I go back to record number 1, button 2 is selected, not button 1 even though the table still reflects my original selection. I have been looking for an answer on the web for 3 days now. I am not a programmer and actually just stared using access this week. I'm hoping the solution is easy, can someone please reply? I apologize if you respond to me and I dont reply right away...I have to leave and will check this forum tomorrow. Thank You :-)

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Unbound control will just hold the last value selected by the button click. Would have to use code to translate the text value back to the OptionGroup number and set the control. Why not use a combobox bound to field instead of an OptionGroup control?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    same advice as June7; reset up your OptionGroup - this time have it bound to a text field of the underlying record source table...and during the wizard set up - while the default values of each option is a number - you can change that to be text - - so you won't have to have any translation code at all.......

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Actually, NTC, I think the OptionValue of a radio button must be a number, therefore the value of OptionGroup control will be a number.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    Indeed it must be an integer. My memory is not what it should be. So there will need to be a translation list in code that occurs either at data entry putting the text value into another bound field (potentially not visible on form) - or at the point of presentation in reports - - although displaying the option group will work.

  6. #6
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18

    Radio buttons within Option Group

    Quote Originally Posted by June7 View Post
    Unbound control will just hold the last value selected by the button click. Would have to use code to translate the text value back to the OptionGroup number and set the control. Why not use a combobox bound to field instead of an OptionGroup control?
    I tried your suggestion and it does work :-), but I still like radio buttons. It makes my form look nicer and more user friendly. I'm not a big fan of drop down boxes and lists. So with that said....is there a way to keep the radio button that I select selected on each record? Getting the text to reflect what I want on the table isn't an issue, just keeping the darn button selected... :-) Thank you -

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Would have to use code to translate the text value back to the OptionGroup number and set the control. This code could be in the Current event.

    The only use I have made of an OptionGroup is an unbound control to select filter criteria. Otherwise, I use comboboxes.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    losingmymind is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2013
    Posts
    18

    Radio Button Code

    Thank you June7 - I wrote a "reverse" code and it worked just like I wanted it to - THANK YOU SOOOOO MUCH!!!!

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

Similar Threads

  1. Use of option group buttons
    By sireesha in forum Forms
    Replies: 1
    Last Post: 10-25-2012, 01:20 PM
  2. Radio Buttons
    By neil123williams in forum Forms
    Replies: 8
    Last Post: 11-11-2011, 03:38 PM
  3. Replies: 6
    Last Post: 07-20-2011, 11:54 AM
  4. Working with Radio Buttons and Option Groups
    By queenbee in forum Access
    Replies: 1
    Last Post: 04-29-2011, 02:25 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