hi, i have created a program but don't know what to do. The condition is when text1.text = empty or it has no value then there would be a msgbox popping out. and for the else, there would be no msgbox popping out.

i really don't know what's the code, like sort of this

If text1.text = no value Then
msgbox ("please input value")
else
end if

can you correct this please?thanks..

there is no need of else ! just if

If Text1.Text = "" Then MsgBox ("Please type something !")

And don't forget, never use it with text change !

Comments
thanks

But what if there are SPACEs in the text box? How about using If trim(Text1.Text) = "" Then to be sure.

Comments
great!

it if LEN(textbox1.text) = 0 THEN Msgbox("Please...")

I repeat, "But what if there are SPACEs in the text box?

hi, i have created a program but don't know what to do. The condition is when text1.text = empty or it has no value then there would be a msgbox popping out. and for the else, there would be no msgbox popping out.

i really don't know what's the code, like sort of this

If text1.text = no value Then
msgbox ("please input value")
else
end if

can you correct this please?thanks..

Try this:

hi, i have created a program but don't know what to do. The condition is when text1.text = empty or it has no value then there would be a msgbox popping out. and for the else, there would be no msgbox popping out.

i really don't know what's the code, like sort of this

If text1.text = no value Then
msgbox ("please input value")
else
end if

can you correct this please?thanks..

try this:

if text1.Text = "" then
MsgBox("Please input Value")
Else
End if

This question has already been answered. Start a new discussion instead.