Using NOT for boolean value

  • Thread starter Thread starter Dave
  • Start date Start date
D

Dave

I have a checkbox that I set to "true" as

chkSuppressHeader = 1

But when I run the following debug statements....

Debug.Print "chkSuppressHeader " & Str(chkSuppressHeader)
Debug.Print "Not chkSuppressHeader " & Str(Not chkSuppressHeader)

,,,I get this...

chkSuppressHeader 1
Not chkSuppressHeader -2


Why is "Not chkSuppressHeader" = -2? I would think it would be 0 (False)
 
Dave said:
I have a checkbox that I set to "true" as

chkSuppressHeader = 1

True is -1, not 1.
,,,I get this...

chkSuppressHeader 1
Not chkSuppressHeader -2


Why is "Not chkSuppressHeader" = -2? I would think it would be 0 (False)

True is -1, NOT -1 gives 0 since NOT TRUE is FALSE.
NOT 0 gives -1 which is TRUE.

Tom Lake
 
In Access true is -1, not 1.

Not sure why you are getting -2, but I assume it is because it does not know
how to handle "not" when you have not entered a valid true or false
statement.
 
Back
Top