A VBA expression where 2=True would return False. Null=True returns Null and in an IIf() that would evaluate to the False condition.
?-1=True
True
?2=True
False
?Null=True
Null
?IIf(Null=True,"A","B")
B
CBool() forces number input to be treated as True or False, not that the input is True. Errors on non-numeric input.
Still, a Yes/No field is either True or False, never Null. Yes, an UNBOUND textbox can have triple state set to allow Null and if that were used as criteria in query no records return: SELECT * FROM table WHERE Active=Null;
Also, no records return for: SELECT * FROM table WHERE Active=2;
So, I have to correct my earlier statement. Only True and False (-1/0) are recognized by Access Yes/No field. Even though Active=2 is False, query does not return records where Active is False, as with Null, just cannot evaluate. Wrapping input in CBool() could handle the 2 input but not Null (secondary wrap with Nz?).
Access sees linked SQLServer Boolean field with -1 and 0 values. Type input as anything but -1 or 0 and the field will show True (-1). Try Delete and get error as cannot be Null, at least not in my linked field.
I suppose pass-through query would have to use 1 for True.