Reputation: 4966
Why does the following not work?
If IsNull(Me.TextBox1.Value) = True Then
MsgBox "Null"
Else
MsgBox "Not Null"
End If
Here, I don't enter any value in "TextBox1" but it still passes the first if
loop and displays "Not Null"
How do I check for null values?
Upvotes: 2
Views: 23775
Reputation: 1
I think, the default value of blank textbox is ""
Try:
If (Me.TextBox1.Value) = "" Then
MsgBox "Null"
Else
MsgBox "Not Null"
End If
Lets see if it is working
Upvotes: 0
Reputation: 2790
I don't have Excel on my computer, but can you try Me.TextBox1.Text
instead of Me.TextBox1.Value
.
Upvotes: 0