Changing 0 to -1 to Yes/No

vent

Registered User.
Local time
Today, 05:58
Joined
May 5, 2017
Messages
160
Hi everyone so I have a list box with a yes/no data type column. I also have a text box set to that specific column and on the list box, each row in the list box appears as either yes or no but on the text box the values are either 0 or -1. How can I make the text box display the same as the list box?

Thank you!
 
I would actually recommend using a checkbox instead, or failing that, a combo box. The combo box would be 2 columns, the bound column would be 1, the Row Source Type would be 'Value List', and the Row Source would be
Code:
True;"Yes";False;"No"
Is there a specific reason you want the numeric value to be displayed? Because the stored value isn't actually 0 or -1; the database is actually storing True and False, and Access interprets those as 0 and -1 for display. (Or at least that's what I got from a horrifically long, combative, abstruse discussion elsewhere on the forum a couple months back. I'm sure Galaxiom will waste no time correcting me if I'm wrong.)

In fact, if you ever find yourself working with SQL Server, you'll find that IT stores bit fields (its equivalent to the Yes/No field) as 1, 0, or NULL. Access will turn around and convert them to -1, 0, and a really annoying error.
 
I would actually recommend using a checkbox instead, or failing that, a combo box. The combo box would be 2 columns, the bound column would be 1, the Row Source Type would be 'Value List', and the Row Source would be
Code:
True;"Yes";False;"No"
Is there a specific reason you want the numeric value to be displayed? Because the stored value isn't actually 0 or -1; the database is actually storing True and False, and Access interprets those as 0 and -1 for display. (Or at least that's what I got from a horrifically long, combative, abstruse discussion elsewhere on the forum a couple months back. I'm sure Galaxiom will waste no time correcting me if I'm wrong.)

In fact, if you ever find yourself working with SQL Server, you'll find that IT stores bit fields (its equivalent to the Yes/No field) as 1, 0, or NULL. Access will turn around and convert them to -1, 0, and a really annoying error.

Hi

I don't want the text field to display 0 or -1 but just to display the same text as whats in the list box column which is either yes or no. But thank you for the recommendation. I will play around with it more.

I should mention, the listbox's row source is set to a query between two tables.
 
Last edited:
If you HAD to have 0 (for FALSE) and -1 (for TRUE) you could always display the field using not the field itself but CINT(field).
 

Users who are viewing this thread

Back
Top Bottom