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

If Text1.Text = ""  Then

good luck

commented: thanks +0

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 !

commented: thanks +0

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

commented: great! +0

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

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

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

Thank you all for the replies!!!+rep to all of you cheers,

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.