Quick If Question

  • Thread starter Thread starter RPIJG
  • Start date Start date
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top