How do I check for null value in an excel userform textbox?
Why does the followin开发者_JAVA百科g 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?
Try
If me.textbox1= vbNullString then
[]'s
I don't have Excel on my computer, but can you try Me.TextBox1.Text
instead of Me.TextBox1.Value
.
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
精彩评论