Yes/No combo box

F

Falcon08

How can I change a column in a table that has Yes/No as a check box to Yes/No
combo box?

The only way I could think of was to create a table titled Yes/No Category
and entered Yes in row #1 and No in row #2. I used that newly created table
as a source for the column that used to be check box after I changed the
display control to combo box in Lookup tab. But, after I changed it to combo
box, that column still retains the numbers, either 0 or -1, instead of Yes or
No. How can I change it?
 
A

Al Campagna

Falcon08,
Not sure why you would want to do that for just 2 values. But...

I'll assume you'll want the value of that field to be "Yes" or "No"
Your table field where the Yes or No will be strored should be Text
(length = 3)
Bind your combo to that field (ControlSource), and use the RowSourceType
= Value List.
Those values... Yes;No
That's it... you should be able to select "Yes" or "No" from the combo,
and store that value in the bound field.
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
G

Golfinray

You generally change the -1 and 0 to yes and no in your query, form, or
report instead of the table. In a query, use IIF([yourfield]=-1,"Yes","No")
 
J

John W. Vinson

How can I change a column in a table that has Yes/No as a check box to Yes/No
combo box?

The only way I could think of was to create a table titled Yes/No Category
and entered Yes in row #1 and No in row #2. I used that newly created table
as a source for the column that used to be check box after I changed the
display control to combo box in Lookup tab. But, after I changed it to combo
box, that column still retains the numbers, either 0 or -1, instead of Yes or
No. How can I change it?

Don't bother.

What's stored in the table is -1 for True and 0 for False. How it's DISPLAYED
in the table is irrelevant, since you should not be opening table datasheets
for interaction with the data in any case. You can create a Form with a
checkbox control on it, or a combo box, or whatever you wish.
 
K

Ken Sheridan

You could just have a combo box with a RowSourceType of Value List and a
RowSource of Yes;No and a Format property of Yes/No. Access recognizes Yes
and No as Boolean constants so you don't need to change the data type of the
field, you can keep it as Yes/No.

However, if you do this and set focus to the combo box by clicking into it
you'll see the underlying value of -1 or 0, which is how Access implements a
Boolean True or False. So a better way is to again use a RowSourceType of
Value List but a RowSource of:

-1;Yes;0;No

Then set the other properties of the combo box as follows:

BoundColum: 1
ColumnCount: 2
ColumnWidths: 0cm;8cm

If your units of measurement are imperial rather than metric Access will
automatically convert the last one. The important thing is that the first
dimension is zero to hide the first column and that the second is at least as
wide as the combo box.

The hidden first column of the combo box contains the actual value (-1 or 0)
of the field, but you see Yes or No in the control and in its list.

Ken Sheridan
Stafford, England
 

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