Option Group not showing table data

MelodeeLRS

New member
Local time
Today, 08:59
Joined
Jan 29, 2014
Messages
9
I have an Option Group I created (simple Yes-No) in a form that links to a Yes-No field in a table. I have the default set for this field to "Yes" in the form. The option button works when the form is first opened. If I cange the option to "No", that works. Here's the tricky part that is giving me eye twitches...

If I change the option back to "Yes", the radial button doesn't reflect the change...but it does change the table data! Why do the radial buttons stop changing? Even when I close the form and open it again, the data in the table is no longer reflected with the buttons in the form.

Any ideas? I have 64-bit, Access 2010.
 
I am not 100% sure here because I don't use Yes/No fields but I think the Yes/No field actually stores the string values (i.e. "yes" or "no") whereas with an option group you are storing a number (i usually assign 1 for yes and 2 for no). So you need to change the data type to number in your table and make a value list and enter this into the row source:

1;"Yes";2;"No";0
 
BTW I use 0 so that there are no null values (usually set the default to 0). You don't have to do that but it helps if you want to use your option group as a filter.
 
The values for a Yes-No field are stored as either 0 (=No) and 1 (=Yes). I thought of this as well, which is why I used the Yes-No field to avoid the numeric-character issue.
 
If you really want it to be a yes/no field why not just use the default check box then? Why does it have to be an option group?

Do you have two option boxes--one for yes and one for no? Is the yes button set to 1 and the no to 0 (in design view>properites>data tab>option value)??
 
The form must mirror the hard copy form guys take to field to do site checks. They check either Yes or No on the hard copy. The option group works fine, as long as it is only used twice - eg change from default to opposite then back. After that, the selection no longer appears in the form, but does reflect correctly in table. It came up while doing QA/QC before going live. Is it a glitch in the software or do I have a setting that is off? In theory, I should be able to change the option and it always show in the form.
 
If you have the option value properties set properly, it should work without any glitches assuming No=0 and Yes =1.

Still, IMHO you should do as I previously suggested and change the data type to number and use a value list to set the values. Why bother using Yes/No when you can use a number type and set it yourself with only a small amount of extra effort at the outset that saves headaches like this later on??

Yes/No is meant to be used with that checkmark. I personally hate the checkmark because it seems ambiguous so I use option groups with a number data type.

I have done this on forms and it never ever fails.
 
From where did you guys get the idea that Yes=1 ? This is Access, and Access has its own rule: Yes=-1
 
From where did you guys get the idea that Yes=1 ? This is Access, and Access has its own rule: Yes=-1

Ha ha, I admitted that I didn't know the exact values in my first reply. The OP said it was 1 and 0. So, I was just going off what s/he said. Probably not the best idea...

Since the OP really wants to use an option box, my suggestion was to set the values using a number data type instead of using a Yes/No data type. IMO, that is the best way to do it.
 
Thank you both for your insights!
I was basing the 1=Yes on the fact that is how it appears in a query...silly me! :D

I will try changing the parameters for Yes and see if that fixes error. I was trying to avoid having to redo all the tables in this database to accomodate the Yes-No issue...but may have to.
 
It should work if you set the option values to -1 and 0 (for yes and no).
 
Fixing the Yes option to -1 fixed the display issue. Thanks again to all!
 

Users who are viewing this thread

Back
Top Bottom