Yes/No fields

K

kev

Hi folks:

I want to use yes/no fields but I am a little wary of
doing so, when I can use a Byte type field with values 0/1
instead. I'm interested in the Yes/No field because it
only requires 1 bit instead of 1 byte. I just don't trust
it yet.

Is there anything nasty about yes/no fields that I should
be aware of? What does access really store for the value
of this field? Is it always -1/0 or does it depend on the
format and display control? Is it equivalent to the
SQL 'bit' datatype? In code, can I refer to the value in
various ways (true/false, yes/no, -1/0, on/off)?

Is it just easier to use the Byte type instead?

Thanks for any help.
 
A

Allen Browne

The Yes/no field type is always -1 for true and 0 for false.
In VBA code or SQL statements, you can use the words True and False.

The only limitation is that it literally contains only True of False: Null
is not an option.
 

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