Format display in a yes/no field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have created a simple combo box with two values, yes or no. The drop list
displays yes and no, but when you select one of those values it displays in
the record as 0 or -1. How do I format it to show the words? (I'm using
Access 2000)
 
Hi, Peter.

Is the field bound to a Yes/No field? What is the combo box' RowSource?
This could be done by a 2-column combo box, where the rows were:

-1;"Yes"
0;"No"

with the Bound Column set to 1, the ControlSource set to the name of the
field you're storing it to, and the ColumnWidths set to 0";x", x being as
wide as you need.

You may wish to also consider a checkbox or option group control.

Hope that helps.
Sprinks
 
I’ve made the changes you suggested, and it now displays yes/no, so thanks
very much! But to be honest, I don’t understand why that process was
necessary. More details…

The database is being set up to prepare for a church jubilee next year. The
main table is a list of names and contact information. One field in the
table is called “Registrationâ€, and marks who will be coming to the jubilee.
The data type is set at yes/no. In the table a lookup list with values “yesâ€
and “no†works as it should.

But in the form based on that table it didn’t, even though I thought I was
following the same process. The field properties showed the following:
Control source = Registration (I presume that makes it a bound field??)
Row source = ‘Yesâ€;â€Noâ€

So I’ve got something that works, but I’d be better off if I understood why
it has to be that way…

Thanks.
 
The database is being set up to prepare for a church jubilee next year. The
main table is a list of names and contact information. One field in the
table is called “Registration”, and marks who will be coming to the jubilee.
The data type is set at yes/no. In the table a lookup list with values “yes”
and “no” works as it should.

What is STORED in the table is a number, -1 for Yes, 0 for No. That's
the way Yes/No fields work.

The Lookup List in your table IS NOT WHAT IS STORED. It's a display
tool; in fact it *conceals* what is stored in the table.

Access provides a number of different ways to display yes/no fields -
checkboxes (checked = yes), combo boxes (your lookup list, with the
Yes option storing -1 and the No option storing 0), or textboxes. The
textbox can be formatted to display -1/0, True/False, Yes/No or
various non-English options... but what's stored in the table is a
number.

John W. Vinson[MVP]
 
Peter K said:
I have created a simple combo box with two values, yes or no. The drop list
displays yes and no, but when you select one of those values it displays in
the record as 0 or -1. How do I format it to show the words? (I'm using
Access 2000)
 
I have the same problem; but with a text box instead of a combo box. The text
box is linked to a Yes/No field on a query. Is it possible to avoid the box
displaying -1 or 0 when I click on it?
 
Change the format property for the field in the table to Yes/No or a
checkbox, do the same in the form.
 
Arvin,

That's the problem, I already did those things:

Form Field: Yes/No
Query Field: Yes/No
Underlying Table field: Yes/No

When I view the Table and the Query, the field has a checkbox!, but the form
field correctly displays Yes or No; but when I click on the form field, it
reveals either the 0 or -1; neither of which I want to see.

PS: I'm Using Access 2007
 
A Boolean (Yes/No) field actually holds the values of -1 (yes) or 0 (no). If
you use a checkbox or radio button to display, you will never see the -1 or
0. Unfortunately the Input Mask property only works with text or date
datatypes, or you might be able to use that. I suggest that you use a check
box on a form and the yes/no format in reports.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
J_Goddard via AccessMonster.com said:
Hi -

If you want to see the fiels as Yes/No in table view, to to table design.
For the field you want to change, under the Lookup tab, set Display
Control
to Text Box, and under the General tab, set the format to Yes/No.

These are for A2000, but should work in A2007 (not tested - I don't have
A2007)

John,

His problem is that it displays properly, but when he clicks in the textbox
to edit he gets the values -1 and 0. This is the behavior that cannot be
changed.
 
Arvin,

That is indeed my problem.

One would have thought that when Microsoft's testers were taking it through
the dev stages that it would have irritated them as much as it does me, and
presumably many end users...
 
Back
Top