Solved

How to use OR in an IF THEN statement

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
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…

690 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