
Originally Posted by
ranman256
-1 is another word for TRUE.
it sets a binary field to true.
Well, you've commented on something that bugs me from time to time because of not remembering something. We probably agree that 0 is always False (or No/Off) but I have run into occasions in writing code where I had to use 1 for True (or maybe it was Yes) but for the life of me, I cannot recall why - just that it tripped me up at first. According to this page for 2013/2016, True/Yes (and I presume On) can be 1 or -1, which doesn't seem to be accurate for 2007 as far as I can tell - at least not in a query and not in a sql based recordset. I haven't been able to find any web results that apply to version 2007, so if anyone can shed light on when True/Yes/On (which are formats for the bit value) has to be represented by 1 I'd appreciate it.
The only thing I'm not sure I'd say is that -1 sets a binary field to true, since a binary field can only be a number. It's the format of the table yes/no field that governs how Access represents that field when using it in a form or report. So 0 is displayed as False, Off, or No and I believe the default control will be a check box.
It would seem that Allen Browne stopped using them - http://allenbrowne.com/noyesno.html
Last edited by Micron; 04-17-2017 at 11:44 PM.
Reason: correction
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.