Solved

How to use OR in an IF THEN statement

Posted on 2006-11-08
2
154 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 65

Accepted Solution

by:
Jim Horn earned 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

895 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now