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..

Recommended Answers

But what if there are SPACEs in the text box? How about using
[iCODE]If trim(Text1.Text) = "" Then [/iCODE]

to be sure.

Jump to Post

All 8 Replies

Re: help in my program textbox = no input visual basic 6.0 80 80

try

If Text1.Text = ""  Then

good luck

commented: thanks +0
Re: help in my program textbox = no input visual basic 6.0 80 80

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
Re: help in my program textbox = no input visual basic 6.0 80 80

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

commented: great! +0
Re: help in my program textbox = no input visual basic 6.0 80 80

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

Re: help in my program textbox = no input visual basic 6.0 80 80

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

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

Re: help in my program textbox = no input visual basic 6.0 80 80

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

Re: help in my program textbox = no input visual basic 6.0 80 80

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:

Re: help in my program textbox = no input visual basic 6.0 80 80

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 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.