|
-
May 19th, 2002, 08:11 PM
#1
Thread Starter
Hyperactive Member
or statement
How can I use an OR staement in an If/else block? see examle:
If text1.text = "jan" or "cindy" or "lisa" Then
end If
That would be what I need to do, but that doesnt work.
Any ideas?
-
May 19th, 2002, 08:14 PM
#2
PowerPoster
Try using a Select...Case statement instead:
VB Code:
Select Case Text1.Text
Case "Marcia", "Jan", "Cindy"
'Do Stuff
Case Else
'Do other stuff
End Select
This would be more appropriate to your solution, I would sauy, but if you must use an if-block, you need to do it like so:
VB Code:
If ((text1.text = "jan") or (text1.text = "cindy") or (text1.text = "lisa")) Then
end If
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
May 19th, 2002, 08:15 PM
#3
-= B u g S l a y e r =-
VB Code:
If Text1.Text = "jan" Or Text1.Text = "cindy" Or Text1.Text = "lisa" Then
a better way is to use Select Case
VB Code:
Select Case UCase(Text1.Text)
Case "JAN"
'do stuff
Case "CINDY"
'do Cindy stuff
Case "LISA"
'do it to lisa
Case Else
'if none of the above
End Select
-
May 19th, 2002, 08:16 PM
#4
PowerPoster
Too slow, Norweigian.
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
-
May 19th, 2002, 08:16 PM
#5
-
May 19th, 2002, 08:18 PM
#6
PowerPoster
It's like Anti-Trust.... now where'd you hide the camera you sneak?!?
-----------------------------------------
-RJ
[email protected]
-----------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|