Check box value

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

Guest

Hi..Thanks in advance..

I have a series of (unrelated) check boxes on my form. When checked the
value in the corresponding field turns from "0" to "-1"

I can't figure out why it's "-1" instead of "1" . I'd like it to be either
"1" or "yes" in the table.

When I look throughout the properties, I don't see anything that's specified
as "-1"

thanks
 
Hi,


-1 is for true/yes/on while 0 is for false/no/off. That is, when you
receive an answer from the computer.

It is -1, not +1, because internally, -1 is represented by the whole 16 bits
(or 32 bits) all set to 1. On the other hand +1 is internally represented
as a lot of zero, but the last bit, alone, set to 1. In fact, you can use
ANY number, except 0, for true/yes/on. Internally, when you supply values,
the computer make the test as "is it 0 or is it not", ie. only 0 really
matters, for a blatant false, no, off, everything else is consider true,
yes, on.

You can FORMAT the result, if you like something else:


? Format( 32, "Yes/No"), Format( 0, "Yes/No")
Yes No




Hoping it may help,
Vanderghast, Access MVP
 
Thanks for the response.
When you say "format the response" - are you saying after the fact, I mean,
after the box has been checked/not checked?

Is there no way that you can change the properties of teh checkbox so that
it returns a value of "yes" or "no" on the table?
 
So, you want to use the column DataType as a Text for that table.

Use the on click event on your control like

If YourCheckBox = -1 Then
YourCheckBox = "Yes"
Else
YourCheckBox = "No"
End If
Thanks for the response.
When you say "format the response" - are you saying after the fact, I mean,
after the box has been checked/not checked?

Is there no way that you can change the properties of teh checkbox so that
it returns a value of "yes" or "no" on the table?
[quoted text clipped - 31 lines]
 
Hi,


In the table, you will get a checkbox. In a textbox in a form, there is a
property called Format you can assign it to Yes/No. You use the Format( )
method if you built a string, explicitly.


Hoping it may help,
Vanderghast, Access MVP
 
Back
Top