how can i check to see if a user put something in a text box?
Printable View
how can i check to see if a user put something in a text box?
sorry if you read the first post I made, I seem to have misread the question :rolleyes:. Use this :
VB Code:
If Trim(Text1.Text) = "" Then MsgBox "Nothing there" End If
:)
thanks...what's 'Trim' do though?
ya see, I'll have 5 text boxes and the user will only need to put info in 2 of any box. And I want to check to see which 2 the user put info in.....
Trim() just taking off any leading or trailing spaces.
Like if Text1.Text = " Hello ", then Trim(Text1.Text) would equal "Hello"
:)
Also, try this. It is pretty much the same.
if text1.text="" then
msgbox "Please insert text"
end if
as for wanting to see what is put into the 2 text boxes, try this:
msgbox=text1.text
msgbox=text2.text
i dunno if thats what u mean, but if it is, u will get two message boxes showing the text. I made a prog once, taht was pass protected, and it showed a message box, with the password, if the password put in both boxes was the same. If thats what you mean, try this:
if text1.text=text2.text then
msgbox "You chose: " & text1.text & " As your password."
end if
Maybe those will help.