summing a text box



I have a report with a controls "minor" "balance" "debits'' and "credits" in
"minor footer" . The control "debits" is an IIF statement:
=IIf([balance]>0,[balance],0) and the "credits" is
=IIf([balance]<0,[balance],0) . In the report footer, I cannot get the
debits and credits to total. I've tried just simple =sum([debits]) and also
more complicated =Sum(Reports![R_BALANCE SHEET]!DEBITS) and it doesn't even
give me an error message just opens the report with nothing in the footer.

I may be going about this all wrong. "Balance" is from a query and on the
report since it's in the minor footer it's giving me a sum. Until I get the
sum, I don't know if I will have a credit or debit. Therefore, I don't think
I can get credit or debit from a query. "Balance" is in the minor footer,
however, it is not visible.

I'm sure I've totaled an unbound control before, however, I can't figure out
what I'm doing wrong. Any suggestions?

Al Camp

You can't Sum or Avg or Count etc... a field that is unbound. A calculated "on the
Report" field is unbound. I'm surprised
Bind those fields by including them in the query behind the form. Using the query
design grid, create a new column with
IsDebit : IIf([balance]>0,[balance],0)
and another column...
IsCredit : IIf([balance]<0,[balance],0)

Now you have 2 bound fields to calcualte upon.
Place IsDebit and IsCredit on the report, and in whatever appropriate Group Footer or
Report Footer, unbound text controls with...
(ex. Name = TotalIsDebit) = Sum(IsDebit)
(ex. Name = TotalIsCredit) = Sum(IsCredit)
will yield the appropriate sums.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question