Change checkbox to combobox

G

Guest

I just changed a checkbox for a Y/N field in a table to a combobox where one
can check "Y" or "N". Now I can't check either option button in the combobox
and cannot see any data from the table. I did notice that the data in the
table still displays as if it came from a check box (i.e. a box displays
rather than a "1" or a "2").

Have I lost my data or is there something I can do to undo the mess I've made?
 
G

Guest

You can't check anything in a combo box. You only select an item from the
list. If the only choices are Yes or No, a check box is the most logical
control to use.

If the field you are comparing is not a Yes/No (Boolean) type, you could use
an option group with only two option buttons and set the Option Value
properties of the buttons to the two values you expect to find in the table.
 
G

Guest

Klatuu -

I'm sorry but I screwed up and said I used a combo box when I actually did
use an option box with only Y or N options. I originally used a check box
but I realized that I needed to know that I had an answer to something, one
way or another. If the check box wasn't checked, I wasn't sure if I had
performed a certain action.

Anyway, after I made the change, there were "N"s and "Y"s in my data and I
changed them to "2"s and "1"s, thinking that this was my problem. It wasn't.
When I open my form I cannot click either of the option buttons.
 
G

Guest

Is the option group bound to the field that has the 1 or 2?
Are the Option Values for the two buttons set to 1 and 2?
Is the Option Group enabled and not locked?

To ensure an action is taken, you can set the Default Value of the option
group to Null and use the Before Update event to check to see if an option
has been chosen:

If IsNull(Me.MyOption) Then
MsgBox "You Must Select Yes or No"
Cancel = True
End If
 
G

Guest

Well, as I was checking to make sure the answer to your first question was
"yes", I figured out what my problem was. Although I changed the checkbox
to an option group, I neglected to change the data type on the field to
"text" (from Y/N). I made that correction and everything is running normal.

Thank you so much for your time and your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top