Having trouble concatenating....

Mendel

Registered User.
Local time
Today, 11:21
Joined
Jan 18, 2001
Messages
34
I'm trying to write an "if" statement like this

If switch = "Name1" Or "Name2" Then
.....
End If

It gives me a Type Mismatch error.

When I rewrite it like:

If switch = "Name1" Then
...
ElseIf switch = "Name2" Then
...
End If

This works but I'm wondering what I'm doing wrong by trying to concatenate the statement.
If anyone can tell me the correct procedure to concatenate I'd really appreciate it.

Mark
 
Hi Mark,

Try this:
If switch = "name1" or switch = "name2" then

That should do it.

HTH
Robert
 
Thanks. I realized the stupid error of my ways soon after I wrote this. It's amazing how easy it is to forget the little things sometimes.
 

Users who are viewing this thread

Back
Top Bottom