help with Or statement
Select Case frmMaintest.CBox1.Text
Case "bob", "george", "kevin"
MsgBox "You must select another name!"
Exit Sub
Case "john", "tom"
MsgBox "This name is acceptable!"
End Select
"Bob C" wrote in message
...
Can someone tell me how I can shorten the below "Or" statement without
repeating the entire string?
If (frmMaintest.CBox1.Text = "bob") Or (frmMaintest.CBox1.Text = "george")
Or (frmMaintest.CBox1.Text = "kevin") Then
MsgBox "You must select another name!"
Exit Sub
ElseIf (frmMaintest.CBox1.Text = "john") Or (frmMaintest.CBox1.Text =
"tom")
Then
MsgBox "This name is acceptable!"
End If
|