Quick If Question

R

RPIJG

I just want to have an If statement so that...
If textbox1 is empty to do nothing, if Textbox one has a value you i
it, then run the code
 
E

Ed

Not sure what you mean by
if Textbox one has a value you in it

If you mean "If Textbox1 is not empty", then
If Textbox1.Text <> "" Then
' your code here
End If

If you mean Textbox1 has a specific word or string in it, then
If Textbox1.Text = "yourstringhere" Then
' your code here
End If

In both cases, if Textbox1.Text is empty, the If will be bypassed. If you
want to do something if it's empty, then in either If, put
' your code here
Else:
' other code if empty
End If

HTH
Ed
 
Top