473,467 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Coding Problem

1 New Member
This is from an Access report designed to sort donors based on their node assignments within our campaign structure and add up total donations for each node.
Ex. –all donors who have given through direct mail “DM” fall under one node, and the report would add up all giving for direct mail.

Original expression (entered in the expression builder for a report in the group footer):
=Sum((IIf([struct]="ADT",[adt2006],IIf([struct]="DM",[indiv06],IIf(([struct]="GA" Or [struct]="NA" Or[struct]="TC"),([corp2006]+[wkpl2006]),IIf([struct]="OTH",([corp2006]+[wkpl2006]),IIf([struct]="PR",([corp2006]+[wkpl2006]+[indiv06]),IIf([struct]="UW" Or "ZZ",([corp2006]+[wkpl2006])))))))))

New expression:
=Sum((IIf([struct]="ADT",[adt2006],IIf([struct]="DM",[indiv06],IIf(([struct]="GA" Or [struct]="NA" Or[struct]="TC"),([corp2006]+[wkpl2006]+[indiv2006]),IIf([struct]="OTH",([corp2006]+[wkpl2006]),IIf([struct]="PR",([corp2006]+[wkpl2006]+[indiv06]),IIf([struct]="UW" Or "ZZ",([corp2006]+[wkpl2006])))))))))

If I enter one more variable (and it doesn’t matter what variable it is—I’ve tried several), the sum function returns an error value. I have no idea why this is occurring—I’m not sure if there is some kind of a limit on the Sum() or IIf() function?

But, if I enter a number instead of a variable, there is no problem….
=Sum((IIf([struct]="ADT",[adt2006],IIf([struct]="DM",[indiv06],IIf(([struct]="GA" Or [struct]="NA" Or[struct]="TC"),([corp2006]+[wkpl2006]+5555),IIf([struct]="OTH",([corp2006]+[wkpl2006]),IIf([struct]="PR",([corp2006]+[wkpl2006]+[indiv06]),IIf([struct]="UW" Or "ZZ",([corp2006]+[wkpl2006])))))))))


Can anybody figure out what the problem is?? Thanks in advance
Nov 24 '08 #1
2 1216
ChipR
1,287 Recognized Expert Top Contributor
Just a quick guess since this doesn't seem to be causing you problems, but the documentation here on IIF says:

Note To use logical operators such as "And" or "Or" in the expr argument of the IIf function, you must enclose the logical expression in the Eval function. See the example table that follows.

You can find that here:
http://office.microsoft.com/en-us/ac...288531033.aspx
Nov 24 '08 #2
DonRayner
489 Recognized Expert Contributor
Is indiv2006 correct? maybe it should be indiv06 as elsewhere your expression.
Nov 25 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Berthold Höllmann | last post by:
I have a default coding header # -*- coding: iso-8859-15 -*- in my python files. I now have Problems with this settings. I swithched to Python 2.4.1 under Windows. When I import files with the...
2
by: manning_news | last post by:
Has anyone had a problem with Access 2003 not saving their coding? I've been using 2003 for a couple of months now and just this week noticed that some coding I'd done for a database was not there...
144
by: Natt Serrasalmus | last post by:
After years of operating without any coding standards whatsoever, the company that I recently started working for has decided that it might be a good idea to have some. I'm involved in this...
1
by: R Reyes | last post by:
Hello All, I'm always looking for ways to improve my code. Most of the time (whenever I'm working on a project) I write a bunch of functions. Then after the project is finished, I put all the...
20
by: TJ Doherty | last post by:
Need help understanding the following please: When I am creating a project and code my connection using Dim connectString As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & "Data...
4
by: Josh Golden | last post by:
i lead a small development team (based on some of my posts that might cause some people to choke themselves, but have no fear, i am NOT the lead developer, the people on my team are great - i'm...
8
by: Ilias Lazaridis | last post by:
Where can I find practical coding examples for real life coding problems? Something like a categorized solution guide? - My current problem: * create a folder * seems to be:...
7
by: Robert Seacord | last post by:
The CERT/CC has just deployed a new web site dedicated to developing secure coding standards for the C programming language, C++, and eventually other programming language. We have already...
0
by: pat | last post by:
CodeCheck Coding Standard's Support As a free service to our customers we offer support in developing "rule-files" for automating corporate coding standards. If you have a coding standard that...
8
by: =?ISO-8859-1?Q?Arnaud_Carr=E9?= | last post by:
Hi all, I guess you all know how difficult it is to choose a conding standard. And even more difficult it is to explain the choice to your dev team :-) I'm looking for an "official" c++ coding...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.