Why NULL?

R

Rod

Any idea why this results in NULL:

If [CALLED_ON] = Null Then
[COMMENT] = Date
End If

CALL_ON: Short Date
Comment: Text

I have also tried:
If [CALLED_ON] = Null Then
[COMMENT] = Date$
End If

Same result. CALL_ON comes in as NULL which causes the statement to be
true, but COMMENT is never updated.
 
R

Rick B

Did not get past your first line of code.

NOTHING will ever be EQUAL to NULL.

If [CALLED_ON] = Null Then

Should be


If IsNull([Called_On]) Then

Almost this exact issue has been answered at least once today alone. In the
future, I'd suggest you search for your answers before posting a new thread.
The easiest way I have found is to go to www.google.com, click the "groups"
options, and enter a search string starting with the following...

microsoft.public.access NULL
 
M

Marshall Barton

Rod said:
Any idea why this results in NULL:

If [CALLED_ON] = Null Then
[COMMENT] = Date
End If

CALL_ON: Short Date
Comment: Text

I have also tried:
If [CALLED_ON] = Null Then
[COMMENT] = Date$
End If

Same result. CALL_ON comes in as NULL which causes the statement to be
true, but COMMENT is never updated.


Null is never equal to anything, not even another Null.
Think of Null as meaning Unknown. You can not say if one
Unknown value is equal to another Unknown value or not.

Use the IsNull function to check if something is null:

If IsNull([CALLED_ON]) Then
 
Top