Also, does it matter that "Category" is a combo box?
:
MacNut,
Did you read my last post on 4/11 @ 12:24? Please do....
Please answer all...
Is Category a "bound" Numeric field, and is Category on the subform?
Is Amount a "bound" Numeric field, and *NOT* a calculated field (Like... Price *
Qty
=
Amount)
When you say you get an error, is it "#Error"
To simplify the matter, why don't we just try the Footer calculation. Remove the
IAm200 from the query, and we'll try to summ the 200 Amounts directly in the footer.
Again, Amount can not be a calculated field on the subform...
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
Al,
I tried putting "Iam200" in the query behind the scenes and then the
sum(Iam200) in the form footer and i have an error in that calculated field
in the form. What am I doing wrong? The following is what I have in my query:
Iam200: IIf([Category]=200,[Amount],0)
Thank you,
MN
:
MacNut,
Well, the concept is the same for a subform, or a report.
I may have made a typo in my second reply... see below. I think I pasted some
code
from my testing by mistake.
First, use a continuous subform, and in the Form Footer, place a field named
Total200Amounts (don't use a name that matches the name of any element in the
calculation), and give that a ControlSource of...
=Sum(IIF(Category = 200, [Amount], 0))
Amount can't be a calculated field itself, it should be a "bound" field.
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
Also, I meant to say it was a subFORM, not report, if that makes any
difference with those errors.
Thanks!
MN
:
Mac,
Also, without the query calculated field... in any footer...
= Sum(IIF(Category = 200, 200, 0))
--
hth
Al Campagna . Candia Computer Consulting . Candia, NH USA
Microsoft Access MVP
http://home.comcast.net/~cccsolutions
"Find a job that you love, and you'll never work a day in your life."
Hello,
I have some fields in a subreport -- ID, category and amount, that I need to
total. For instance, I need a total of "amount" where each category is
"200", not including any other cateogry.
How do I do this? I Tried it, and it worked when there was only ONE RECORD
in that particular ID. If there was a category 200 and another record for
that ID that was 203, it's adding the amoutns for both categories together.
What am I doing wrong?
here is my if statement:
=IIf([Category]=200,Sum([Amount]),0)
Thank you!
MN