?
Solved

How to use OR in an IF THEN statement

Posted on 2006-11-08
2
Medium Priority
?
159 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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 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…
Suggested Courses

762 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