-
I will probably get laughed out of this forum but I need to know how to check for more than on thing in an IF statement.
Ex. if richtextbox1.text = ^6,^7,^8,^9 then
whatever...
I don't want to have to nest if statements if at all possible. Please help.
GiD
-
You could use OR Operator.
Code:
With Text1
If .Text = "^6" Or .Text = "^7" Then
'Do whatever you want
End If
End With
'you don't have to use With statement
'it just makes code look less
'complicated to me (and shorter too)
Hope this will help
------------------
Visual Basic Programmer
-----------------
PolComSoft
You will hear a lot about it.
[This message has been edited by QWERTY (edited 11-04-1999).]
-
Use OR keyword.
If something = "BLAH" or something = "MORE BLAH" Then
do something.
End if
If you can multiple different cases you want to check you can also user Select Case.
SELECT CASE richtextbox1.txt
CASE 1
do something
CASE 2
do something
CASE 6,7,8,9
do something
END SELECT
-
Thanks a lot guys. I had a brain fart there! :)
GiD