Solved

MS ACCESS 2007 syntax on ACCESS:  IIF/Or statement

Posted on 2014-03-27
3
557 Views
Last Modified: 2014-03-28
the following script runs and delivers good results on the pre-"Or" statement.  However, it is ignoring the post-"Or" statement:

TG:
IIf([Do we want to see an increase in this Measure?]=True And [TmsrAmt]![Target]>[Data],[TmsrAmt]![Target],[Data]-([Data]*0.05)
Or
 IIf([Do we want to see an increase in this Measure?]=False And [TmsrAmt]![Target]>[Data],[Data]-([Data]*0.05)))

Assistance please
0
Comment
Question by:willjx
3 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39961082
Hi,

pls try

IIf([TmsrAmt]![Target]>[Data],IIf([Do we want to see an increase in this Measure?]=True,TmsrAmt]![Target],[Data]-([Data]*0.05)),[Data]-([Data]*0.05))

Open in new window

Regards
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39962157
I'm assuming that this is being used in a query and that:

[Do we want to see an increase in this Measure?]

is actually intended to be an input box or a parameter.  If that is the case, did you declare this parameter as a boolean? If not, you might want to try:

IIf([Do we want to see an increase in this Measure?]="True" And [TmsrAmt]![Target]>[Data],[TmsrAmt]![Target],[Data]-([Data]*0.05)

The IIF() statement in the 2nd part is formatted improperly, it should have three arguments, one that evaluates to True/False and then the value for True, followed by the Value for False.  Yours only has 2 arguments.
0
 

Author Closing Comment

by:willjx
ID: 39962763
After I added a [ after the 1st "True",    (=True,  [TmsrAmt] !)
this solution worked beautifully.
--matched perfectly with results my user provided in Excel.
Thanks.
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This article will shed light on the latest trends when it comes to your resume building needs. For far too long, the traditional CV format has monopolized the recruitment market.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

803 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