Option Group on Continuous Form - updating all records (1 Viewer)

GinnyR

New member
Local time
Today, 07:25
Joined
Apr 27, 2023
Messages
24
I have a simple option group set up to record responses to questions on a form (Yes, No, Pending). This works perfectly for single records. I have the list of questions on a continuous form binding to a Query for the selected questions. So in design mode there is a single record with one option group. When the form is opened in form view all questions are displayed with the option group beside each question. When any of the options are chosen all questions show this response in the option group instead of the individual question required. How do I confine the response to the individual question? Any help with this would be very much appreciated.

Thanks in advance
Ginny
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:25
Joined
Oct 29, 2018
Messages
21,473
Hi. Sounds like your option group is unbound. If so, try binding it to the response field.
 

GinnyR

New member
Local time
Today, 07:25
Joined
Apr 27, 2023
Messages
24
Hi. Sounds like your option group is unbound. If so, try binding it to the response field.
Thanks for coming back to me. No, the binding is working fine. My problem is isolating the current record so that the response only appears in the current record instead of all the questions. If it wasn't bound it wouldn't appear at all.
Ginny
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 23:25
Joined
Oct 29, 2018
Messages
21,473
Thanks for coming back to me. No, the binding is working fine. My problem is isolating the current record so that the response only appears in the current record instead of all the questions. If it wasn't bound it wouldn't appear at all.
Ginny
Not sure we're talking about the same thing. If the option group is bound, what is in its Control Source property?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 01:25
Joined
Feb 28, 2001
Messages
27,186
In a continuous form, there is only one set of controls (no matter how many lines are on the continuous part of the form) and that set relates to the currently selected record among the continuously displayed form. If the control is unbound, then EVERY visible instance of that control displays the same thing. If the control is bound, then it should reflect the value of the bound field, and selecting one option from the group should only change the value for the selected record. If you have behavior other than this, something is incorrectly set up.

Actually, what I just said applies to ANY control in the form-detail section of a continuous form, not just option groups.
 

GinnyR

New member
Local time
Today, 07:25
Joined
Apr 27, 2023
Messages
24
Not sure we're talking about the same thing. If the option group is bound, what is in its Control Source property?
The frame of the option group is set to the Field. Actually I've realised that the responses are correct in the table, but the options on the form are all showing the same. If I click No on one Option Group all the No's are activated. There must be something on my form that's interfering. I have this form, plus others as subforms of a main form and I thought that might be the problem. I'm going to go back to basics and work on this in a test DB and see if I can spot where I'm going wrong.

Thanks again. I'll update this with progress.
Ginny
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:25
Joined
Feb 19, 2002
Messages
43,275
I would delete the option group control from the form and then add it back. Make sure the controlSource of the group is bound to the correct column. The individual options are not bound. Did you add them separately? Is that the problem? Try letting the wizard rebuild the option group for you.
 

mike60smart

Registered User.
Local time
Today, 07:25
Joined
Aug 6, 2017
Messages
1,905
The frame of the option group is set to the Field. Actually I've realised that the responses are correct in the table, but the options on the form are all showing the same. If I click No on one Option Group all the No's are activated. There must be something on my form that's interfering. I have this form, plus others as subforms of a main form and I thought that might be the problem. I'm going to go back to basics and work on this in a test DB and see if I can spot where I'm going wrong.

Thanks again. I'll update this with progress.
Ginny
Hi Ginny
Are you able to upload a copy of the database?
 

GinnyR

New member
Local time
Today, 07:25
Joined
Apr 27, 2023
Messages
24
Hi Ginny
Are you able to upload a copy of the database?
Hi all,
Thanks for the advice and helpful suggestions. I did have extra code added to the DoubleClick Event of the Frame to change value to "". Although I wouldn't have thought this would interfere with the workings of the option group. I deleted the option group and started again with the wizard (I had used it also at the start). I made sure there was no coding anywhere. It is working now fine and the data is being saved correctly in the tables.

Do any of you have advice on how to go about getting the label values of the Options rather than the Index numbers into the field of the table? Should I use a separate field in the database to record these, maybe through coding in the AfterUpdate Event? The data has to be read back into the form so I assume the Index values need to stay in the field in the table.
 

mike60smart

Registered User.
Local time
Today, 07:25
Joined
Aug 6, 2017
Messages
1,905
Hi Ginny
It is recommended that you do not store these values in the table.
When you need to see the values then you would obtain them by using a query based on the Table and then
use an IIf statement to show the values required.
 

GinnyR

New member
Local time
Today, 07:25
Joined
Apr 27, 2023
Messages
24
Hi Ginny
It is recommended that you do not store these values in the table.
When you need to see the values then you would obtain them by using a query based on the Table and then
use an IIf statement to show the values required.
Ok, thanks Mike.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:25
Joined
Feb 19, 2002
Messages
43,275
I did have extra code added to the DoubleClick Event of the Frame to change value to "". Although I wouldn't have thought this would interfere with the workings of the option group.
For starters, Option groups hold numeric values and "" = ZLS (Zero Length STRING - which is not numeric at all!) PLUS, setting a control to a specific value when the form loads dirties the record BEFORE the user types anything and that also leads to issues.

You can use the same technique for your option group that you use to decode a combobox. Have a lookup table that converts the numbers to display values so you can use them as text boxes in reports if you need to.

I never use Option groups to display data. They are too limiting because if you need to add a new option, you also need to modify the form and possibly your code. I use Option groups to display fixed options such as whether an output goes directly to print or is displayed or exported as a spreadsheet or pdf. If I have lists of data values that I want to display as a list, I use a listbox instead of an Option group or combo. But most user choices are made using combos. They require no programming or formatting when you need to add additional values.
 

GinnyR

New member
Local time
Today, 07:25
Joined
Apr 27, 2023
Messages
24
For starters, Option groups hold numeric values and "" = ZLS (Zero Length STRING - which is not numeric at all!) PLUS, setting a control to a specific value when the form loads dirties the record BEFORE the user types anything and that also leads to issues.

You can use the same technique for your option group that you use to decode a combobox. Have a lookup table that converts the numbers to display values so you can use them as text boxes in reports if you need to.

I never use Option groups to display data. They are too limiting because if you need to add a new option, you also need to modify the form and possibly your code. I use Option groups to display fixed options such as whether an output goes directly to print or is displayed or exported as a spreadsheet or pdf. If I have lists of data values that I want to display as a list, I use a listbox instead of an Option group or combo. But most user choices are made using combos. They require no programming or formatting when you need to add additional values.
Thanks Pat. Very useful to know. Option groups are trickier than I thought, so I will stick to the basics for them.

Thanks everyone for the help. Moving on to the next challenge in the DB !!!!
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:25
Joined
Feb 19, 2002
Messages
43,275
If you want to clear the value, set it to null.

Me.fraMyOptionGroup = Null
 

Users who are viewing this thread

Top Bottom