Code:
If Me.outputtext = NULL Then
To answer your question about the above statement, NOTHING is equal to NULL, not even NULL!
In the immediate window, if you type in
? 1 = 1 --> the result is TRUE
? 1 = 2 --> the result is FALSE
? NULL = NULL --> the result is NULL
? NULL = 2 --> the result is NULL
Comparing anything to NULL results in a NULL return value.
You can use:
Code:
If IsNull(Me.outputtext) Then..... (<<-- this doesn't deal with an empty control .... ie where the control is "" )
If NZ(Me.outputtext,"") = "" Then..... (<<--handles NULL or empty values)
If Me.outputtext & "" = "" Then..... (<<--handles NULL or empty values)
If Len(Trim(Me.outputtext & "")) = 0 Then..... (<<--number of characters in control)
If Len(Trim(NZ(Me.outputtext,""))) > 0 Then..... (<<--number of characters in control)
I tend to use either of the last two.....