Results 1 to 12 of 12
  1. #1
    Old Bear is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2022
    Location
    Idaho
    Posts
    4

    Question Option group Radio Buttons not accepting input

    I am an 80 yo that has not looked at any programming since the mid-70's & then it was dBase. I am attempting to write a membership application to replace a "hap-hazard" paper method currently used by my Ham Radio Club. I am using Access 2007 on a Win 10 HP Omen Desktop. I have created a "home page" which will be used to direct the user to various tasks, such as adding members or changing membership info. One of the tasks is to be able to view or print the roster by membership classifications, which are: All; Associate; Current; Inactive; Prospects; & Silent Keys.

    I have created a "pop-up" form & populated it with an option group of 6 radio buttons using the above as labels. I intend to trap the user's choice to direct the program to the correct query using a select case. My home page opens up the pop-up form when the view/print button is selected but the Radio buttons only dim when selected and do not fill-in to show the choice selected (all the ones I have seen darken to show they have been selected?). I have checked to make sure that each button is "enabled". I wrote the below code on the form to try and establish that the buttons were working but get no response when running the app.

    Textbox Code used on the form to try & trap the ogrpSort (my name for the option group) value & "ViewPrint" is the form name:



    =[Forms]![ViewPrint]![ogrpSort]

    Does Access 2007 VBA not darken the buttons when chosen and, if not, shouldn't I get the frame value in the textbox with the above code?

    I did not find a thread addressing this, any help appreciated.
    An "old dog" trying to learn new tricks!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Yes, buttons darken when selected, and referencing option group should trap value. Works for me.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    OldBear-davegri-v01.zip

    Here's a quick workup to demo option group and how to display it.

    Click image for larger version. 

Name:	bearforms.png 
Views:	39 
Size:	27.7 KB 
ID:	47611
    clicking on the 'set up sort' button will load the popup.


    and the code behind the popup

    Code:
    Option Compare Database
    Option Explicit
    
    
    Private Sub ogrpsort_AfterUpdate()
        Select Case ogrpsort.Value
            Case 1
                txtLabel = "All"
            Case 2
                txtLabel = "Associate"
            Case 3
                txtLabel = "Current"
            Case 4
                txtLabel = "Inactive"
            Case 5
                txtLabel = "Prospects"
            Case 6
                txtLabel = "Silent Keys"
        End Select
        Forms("Home").Controls("txtHomeLabel") = txtLabel
    End Sub

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Old Bear; make sure you've added your option buttons to the frame correctly. If you don't, the chosen value won't get passed to the frame as you mentioned.
    After adding the frame, when you have selected the option button from the collection of controls on the ribbon, the frame should darken to let you know that the control will be linked to the frame. If it doesn't do that, the button will not be linked/associated with the frame.

    You're not wanting to select more than one option at a time, correct?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Old Bear is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2022
    Location
    Idaho
    Posts
    4
    I thank you all for your response. I think Micron may be right as my code looks almost identical to davegri's. Will try redoing the buttons and see if that works.
    And, yes only one option at a time.

  6. #6
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    One way to know that one or more are not properly attached to the frame is that unless you've coded to prevent it, you can have more than one active/true at the same time. When attached/bound to the frame, you cannot.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    Old Bear is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2022
    Location
    Idaho
    Posts
    4

    Have tried solutons still doesn't work

    I have tried all the suggested solutions, to include completely re-doing option group with wizard and without. Still get same problem.

    I could not open davegri attachment, gives unknown database format error. I suspect that is because I'm using an older version that is not forward compatible.

    I appreciate your assistance. What I thought should be a simple app has been a pain so far.

    Old Bear
    Attached Files Attached Files

  8. #8
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    Do this:


    Click image for larger version. 

Name:	ob1.png 
Views:	21 
Size:	22.6 KB 
ID:	47635

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    As Dave noted, View form AllEdits property is set to No. Change to Yes.

    Why is AMMRON radio button on View form not bound? No associated code. What is this control for?

    Why is code opening query? Users should not interact with tables and queries. Should build a report and open that instead.
    Last edited by June7; 04-06-2022 at 05:48 PM.
    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.

  10. #10
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,741
    BCARC Membership-davegri-v01.zip

    Spent a bit more time with this revision.
    I think this version is much more functional than the uploaded one.

    Streamlined opening the View form for Edit/New/View modes, getting rid of the unnecessary message boxes and input boxes.
    Added NEW button to View form
    Added Search combo to View form to lookup members.
    Added a report to view the various Member Status settings.
    Added Close button to ViewPrint form

    Note to Bear:

    To force all caps you don't use mask, use format.
    Also, don't assign input mask in table design!
    Click image for larger version. 

Name:	nonobear.png 
Views:	20 
Size:	18.9 KB 
ID:	47637 Click image for larger version. 

Name:	goodbear.png 
Views:	20 
Size:	10.2 KB 
ID:	47638
    Last edited by davegri; 04-06-2022 at 08:23 PM. Reason: clarif

  11. #11
    ssanfu is offline Master of Nothing
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    You have 3 fields in the table that are Look up FIELDS (NOT considered a good idea) - should have Look up TABLEs.
    But then ,for the combo boxes "Status" and "License" on the form "View", you use Value List for the Row Source Type???
    And the control for the field "City" is a text box, not a combo box. The field "City is also a Look up FIELD.

    The field "Call Sign" has a space in the name.

    ------------------------------------------------------

    I made changes to your dB.

    Good luck with your project..... And Welcome to the forum.
    Attached Files Attached Files

  12. #12
    Old Bear is offline Novice
    Windows 10 Access 2007
    Join Date
    Apr 2022
    Location
    Idaho
    Posts
    4
    Again, thank you all.
    For June7: AMMRON is another group that was added as an after thought and I missed binding it. All the groups at the bottom are ones which we may inter-act with at one time or another and just need to know who may have contacts within that group. I agree about the queries and intended to make them into reports (and had started to convert them). However, they were a quick way for me to print out lists for the officers of the club as I reconciled their records and I left them in as a reminder for me. The Club, like many that I have been associated with over the years, was started as "a good ol' boy" group and allowed to deteriate over the years. The current officers are valulantly trying to correct past ommissions. No one seemed to have a handle on that info. To say their current bookkeeping was a disaster would be an understatement. As it is a relatively small group, less than 50, which ever officer got the dues was giving them to the treasurer for deposit and keeping, or not, their own record of who paid with no one's list matching. I'm just trying to formalize the procedure and create a central repository.
    For ssanfu: "value list" was apparently a default of my version of Access as I didn't change that parameter.

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

Similar Threads

  1. Option group radio buttons
    By sharonir22 in forum Forms
    Replies: 3
    Last Post: 07-04-2015, 11:11 PM
  2. Replies: 9
    Last Post: 06-26-2014, 03:10 AM
  3. Replies: 6
    Last Post: 12-04-2013, 07:00 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