Reputation: 117
I set "if" with the "or" condition and give an error
If textbox1.Text = "abc def" Or "def" Then
I understand that I'm not writing right? What is my problem?
Upvotes: 1
Views: 64
Reputation: 1518
If you have many conditions, use Select Case:
Select Case textbox1.Text
Case “abc def”, “def”, “xyz”
MsgBox “Note that multiple values may be captured here, separated by commas”
Case “abc”
MsgBox “Just abc”
Case Else
MsgBox “Everything else”
End Select
Upvotes: 3
Reputation: 14580
You need to restate the test object
If textbox1.Text = "abc def" Or textbox1.Text = "def" Then
Upvotes: 2