Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to code an If... OR statement in VB Script

Status
Not open for further replies.

JohnBates

MIS
Feb 27, 2000
1,995
US
Hello VBScript experts -

I am working with an ASP page.

Need to perform a task If any of a group of values are "on"..

If blnMarcam = "on" OR
blnJDE = "on" OR

I'm getting a syntax error in the above If statement...

Microsoft VBScript compilation error '800a03ea'

Syntax error

If blnMarcam = "on" OR
----------------------^

I have also tried ||

So...........how can I construct the If statement to check for multiple conditions ?

Thanks for any help.

John




 
Couple of things to try:-
1. Is the comparison valid ie. ="on"
2. Try with AND instead of OR see if it works.
3. Try Using the SELECT statement.

Hope this helps
 
Thanks AgentM -

I made the clasical syntax error.

I had: If blnMarcam = "on" OR
blnJDE = "on" Then

I corrected it this way:

If blnMarcam = "on" OR blnJDE = "on" Then

or I could have used a continuation _ after the OR I suppose.

I've got lots of programming experience but I'm new at using the scripting languages. Sorry for the bother. John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top