Page 1 of 2 12 LastLast
Results 1 to 15 of 27
  1. #1
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239

    Question Forms - Radio buttons

    I need help with this please. I have come close to losing my hair because the stakeholders of my project have changed the design yet again. Instead of using combo boxes, I now have to use radio buttons. I'm trying to figure out how to represent each option button on the table. Let me clarify:

    I used a value list on my table as the row source for my combo boxes on my forms. Now I'm wondering how to adjust the table design to work with the radio buttons instead? The row source feature is not showing in the radio button property

  2. #2
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    I think I figured it out. It is the 'group' control that I'll bind to the value list in my table not the individual buttons.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Usually, radio buttons are used in a situation where only one selection is allowed. The radio buttons would be components of an Option Group control. Clicking a button assigns a number value to the Option Group control. The Option Group control can be bound to a field and the assigned value will be saved. Customary situations where only one selection is allowed are: Yes/No, Male/Female, Poor/Good/Fair/Excellent.

    EDIT: Did not see your second post before mine committed. Glad you figured it out.
    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.

  4. #4
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    no worries thanks allthesame

  5. #5
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    Hey June7, could you help me with these please? I have a group control which consists of check boxes. I find that:

    1) I cannot check more than one box in a group, I need to be able to do this.

    2) my table field had values "Yes","No","undetermined" but when I make my selections and save, the values are saved as "1", "2", "3". How do I fix this please?


    3) also if I check a box in the group and decide that I don't want any of them checked, I'm unable to do this. Not sure if this is clear or not but once a box in the
    group is checked, I can't undo this.

    Any help with this is appreciated

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    1. Why would you want to check more than one button in a group? Purpose of option group is to limit selection to one item.

    2. Would have to use code to translate the number values to text and save

    3. true, which is probably why I've never used option group for saving data
    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.

  7. #7
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    not the radio button but the 'check box'. I used check box option group as well. Is there any way I can make it accept more than one checked box?! It will be terrible if I have redesign this redesign

    could you help me with the code to translate this please?

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    An option group will allow only one selection. Don't put checkboxes within option group. Bind each checkbox to its own field. If you want to save multiple choices to a multi-value field, then need combobox or listbox. I never use multi-value field.

    Me!fieldname = Choose(Me.optiongroupname, "Yes", "No", "Undetermined")
    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.

  9. #9
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    thank you June7. Just to be sure, this code goes into the AfterUpdate event of the option group control correct?

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    I would think so.
    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.

  11. #11
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    Hi June7. I put this code in the AfterUpdate event of the option group but now I can't make a selection. When I click on the radio buttons, no selection is made

    Me!O2SaO2 = Choose(Me.SaO2, "Yes", "No", "Undetermined")

    O2SaO2 = table field name
    SaO2 = option group name


    ? I used it for the first option group and was going to test it but it is complaining about the 20 other option groups that I haven't adjusted. Just checking first before doing the wrong thing 20 more times.

    Also in the code, does fieldname
    just to be clear in the code, fieldname refers to the table field, correct?

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    Yes, use table field name, assuming it is included in the form RecordSource.

    Do not bind the OptionGroup control to the field.
    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.

  13. #13
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    June7 you rock!
    you just saved a life. again!

    it worked thank you.

  14. #14
    Sheba is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2014
    Posts
    239
    one thing though...

    how do I get a clean form after I save After I click the SAVE button, the other fields are cleared but the radio button and check box selections remain on the form

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,641
    The OptionGroup control must be unbound because you want to save text, not the number values. Unbound controls retain their values. Must use code to set the control back to Null. In VBA:

    Me.OptionGroup = Null

    Did you bind the checkboxes to fields?
    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.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Radio Buttons
    By maguyver in forum Access
    Replies: 3
    Last Post: 07-07-2012, 10:39 AM
  2. Radio Buttons
    By ccordner in forum Forms
    Replies: 1
    Last Post: 01-27-2012, 09:56 AM
  3. Radio Buttons
    By neil123williams in forum Forms
    Replies: 8
    Last Post: 11-11-2011, 03:38 PM
  4. what happened to radio buttons?
    By judomum in forum Forms
    Replies: 1
    Last Post: 10-09-2011, 11:58 AM
  5. radio buttons from 97 to 2010
    By mmm in forum Access
    Replies: 0
    Last Post: 12-03-2010, 04:20 PM

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