How Do I display a Yes/No Field correctly in a List Box?

T

TekWarrior

I have an Access 2003 project with a List Box on my form that has a Yes/No
field that I set the properties to display as Yes/No, but all that displays
on the List Box is "-1" for True/Yes and "0" for False/No.

How can I correctly display Yes/No?
 
D

Dirk Goldgar

TekWarrior said:
I have an Access 2003 project with a List Box on my form that has a Yes/No
field that I set the properties to display as Yes/No, but all that
displays
on the List Box is "-1" for True/Yes and "0" for False/No.

How can I correctly display Yes/No?


Set the list box's rowsource to a query that formats the field using the
"Yes/No" format:

SELECT Format([YourBooleanField],"Yes/No") AS YN
FROM YourTable;
 
T

TekWarrior

Thanks Dirk, that did it..

Heaven forbid setting it in the GUI properties would do it =D

--

Thanks,
Tek


Dirk Goldgar said:
TekWarrior said:
I have an Access 2003 project with a List Box on my form that has a Yes/No
field that I set the properties to display as Yes/No, but all that
displays
on the List Box is "-1" for True/Yes and "0" for False/No.

How can I correctly display Yes/No?


Set the list box's rowsource to a query that formats the field using the
"Yes/No" format:

SELECT Format([YourBooleanField],"Yes/No") AS YN
FROM YourTable;


--
Dirk Goldgar, MS Access MVP
Access tips: www.datagnostics.com/tips.html

(please reply to the newsgroup)
 

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