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?
Printable View
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?
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
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
Too slow, Norweigian. :D
ok... this is a bit scary :eek: :D
It's like Anti-Trust.... now where'd you hide the camera you sneak?!? :mad: :D