Radio Button Does Not Show Selection After Form is Closed

legalhustler

Well-known Member
Joined
Jun 5, 2014
Messages
1,179
Office Version
  1. 365
Platform
  1. Windows
I have a form with 4 different option groups and contains radio buttons (Yes, No, TBD). I select the values for a record, save it, close the form and reopen the record, but my selection does not show on the form. However, it is showing in the source Table. How can I fix this?

Most of the option groups has a macro associated to it. I'm not sure, but do I need to modify the macro to visibile or something? When I select a radio button and save the form it should save my selection whenever I open the record. Below is an example for one of the radio button option group.

Code:
Private Sub Frame103_AfterUpdate()
Select Case Me![Frame103]
    
        Case 1
            Me![Text101] = "Y"
            Me.Frame112.Locked = False
                       
        Case 2
            Me![Text101] = "N"
            Me.Frame112 = 2
            Me.Frame112.Locked = True
            
        Case 3
            Me![Text101] = "TBD"
            Me.Frame112 = 3
            Me.Frame112.Locked = True
    
    End Select
        
End Sub
 
Last edited:
Thinking out loud...

Why do you need to store those values in the Table when you can get it show in a Query on demand? Then you could bind the Frame and all of this would not be required.
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
2) When I look at my Table, the answer in Frame112 does not reflect the correct answer I picked in my Form. No matter if I select "No" or "TBD" for Frame112 the Table always shows a "Y".

Your code in post one takes care of setting the (real) value for Text101. I see nothing that takes care of setting the (real) value for Text313. Unless there is another after_update event you did not post. Also since the frames are not bound (as pointed out) they won't have anything to do with the values in the table and when you re-open the frames need to be synchronized (such as with an on_current event, also as pointed out).

Note that in the lingo of Access, a Macro is something you create using the Access Macro builder wizards. Unlike in Excel, we don't call vba routines or vba code "macros". We just call it "vba" or "code".
 
Upvote 0
Thinking out loud...

Why do you need to store those values in the Table when you can get it show in a Query on demand? Then you could bind the Frame and all of this would not be required.

I have a Excel spreadsheet that is linked to my Access Table where I do further analysis and charts are auto generated based on the answers for those radio buttons. So I really need to have these text values show up in my Table. In addition, this is data entry form so the users must answer those option groups.
 
Last edited:
Upvote 0
Then my only thought is for you to *do it another way*. Forget the Option Group and use Radio Buttons tied to the Field. One way or the other you are going to have to bind the Control to the Field.
 
Upvote 0
Your code in post one takes care of setting the (real) value for Text101. I see nothing that takes care of setting the (real) value for Text313. Unless there is another after_update event you did not post. Also since the frames are not bound (as pointed out) they won't have anything to do with the values in the table and when you re-open the frames need to be synchronized (such as with an on_current event, also as pointed out).

Note that in the lingo of Access, a Macro is something you create using the Access Macro builder wizards. Unlike in Excel, we don't call vba routines or vba code "macros". We just call it "vba" or "code".

Thanks for the lingo clarification. I did not know that.

You are correct, I don't have any after_update event for Text313. Let me try to create the after_update event for Frame112 which will use Text313. Then re-try putting the on_current event on the Form.
 
Upvote 0
Then my only thought is for you to *do it another way*. Forget the Option Group and use Radio Buttons tied to the Field. One way or the other you are going to have to bind the Control to the Field.

I thought Radio Buttons are part of the Option Group? How would I re-create this? It has to meet my requirements in my post #5.
 
Upvote 0
Your code in post one takes care of setting the (real) value for Text101. I see nothing that takes care of setting the (real) value for Text313. Unless there is another after_update event you did not post. Also since the frames are not bound (as pointed out) they won't have anything to do with the values in the table and when you re-open the frames need to be synchronized (such as with an on_current event, also as pointed out).

Note that in the lingo of Access, a Macro is something you create using the Access Macro builder wizards. Unlike in Excel, we don't call vba routines or vba code "macros". We just call it "vba" or "code".

I am ready to give up. I tried using same code for Frame103 for Frame112 and changed it accordingly but the Table now shows "3" no matter what selection I make in Frame112. The value I selected in Frame103 does pick up correctly in my Table though.
 
Last edited:
Upvote 0
You can put Radio Button on without using an Option Group... there should be an *Option Button* on the Design tab. That one is not part of an Option Group.
 
Upvote 0
You can put Radio Button on without using an Option Group... there should be an *Option Button* on the Design tab. That one is not part of an Option Group.

Is there really a difference between Option Group and Option Button? The Option Group has a nice little frame around the radio buttons that's all, right?
 
Upvote 0
Hmm, good question but you said you can't bind it to a Text field, so I thought perhaps that was because it was in a Group. Have not checked the theory myself.
 
Upvote 0

Forum statistics

Threads
1,215,758
Messages
6,126,706
Members
449,331
Latest member
smckenzie2016

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top