Solved

MS ACCESS 2007 syntax on ACCESS:  IIF/Or statement

Posted on 2014-03-27
3
554 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Microsoft Office Picture Manager is not included in Office 2013. This comes as a shock to users upgrading from earlier versions of Office, such as 2007 and 2010, where Picture Manager was included as a standard application. This article explains how…
Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

863 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

24 Experts available now in Live!

Get 1:1 Help Now