[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to use OR in an IF THEN statement

Posted on 2006-11-08
2
Medium Priority
?
163 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
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's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

831 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