[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

How to use OR in an IF THEN statement

Posted on 2006-11-08
2
Medium Priority
?
160 Views
Last Modified: 2010-04-30
I am sure this is really simple, but I am just beginning to program and cannot figure this out.  What am I doing wrong here...

If [OrderStatus] = "Complete" or "Partial" then
    [Status] = "S"
else
   [Status] = "O"
End If


Ann
0
Comment
Question by:Tuftco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 200 total points
ID: 17901615
For VBA code...

Select Case [OrderStatus]
   Case "Complete", "Partial"
      [Status] = "S"
   Case Else
      [Status] = "O"
End Select

.. or if you reqlly wanted to...

If [OrderStatus] = "Complete" or [OrderStatus] = "Partial" then
    [Status] = "S"
else
   [Status] = "O"
End If
0
 

Author Comment

by:Tuftco
ID: 17901626
Super!!! Thanks so much for the quick response.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question