Sum in footer problem

  • Thread starter Thread starter Gina
  • Start date Start date
G

Gina

Hi .

I have a report that's based on a query .... it contains a field amount ...

I would like to have the overall sum of that amount showing up in the
footer - maybe just on the first page.
changing the query to have a sum([amount]) just shows up the value in that
field amount - so not a sum at all.

trying to use the expression builder for an unbound filed in the footer ends
up in #error showing up the that particular field.

doing a subquery calculating the sum of the records selected by the query
the report is based on works partially ... but only if I TYPE in the values
AGAIN for Min(invoiceNumber) and Max(invoiceNumber) (the same criteria as
for the query the main report is based on) ....

I am sure there must be a better way .... can't use it that way .... ;-) it
simply looks silly

please help

Gina
 
sorry ... forgot to mention that it shows up properly on the first page and
when I gop the the next page it comes up with input for criteria

so I don't know where I am doing the mistake
 
Gina said:
I have a report that's based on a query .... it contains a field amount ...

I would like to have the overall sum of that amount showing up in the
footer - maybe just on the first page.
changing the query to have a sum([amount]) just shows up the value in that
field amount - so not a sum at all.


It's not clear which footer you're talking about here.

A text box in the Report Header/Footer can display the total
of a **field** in the report's record source table/query by
using the expression =Sum(field)
Note that you can not use a control name instead of a field
name.

You can use the identical expression in any Group
Header/Footer to display the total for the group.

You can not use that expression in the Page Header/Footer.

With all that in mind, could you explain, maybe via example,
more about what you are trying to achieve?
 
Hi Marsh.

Thanks for your answer ....
well I hope I can clarify my problem....

right now I have a query2 that should do the summing.
field: the amount
table: the query of the main report
function: sum

this is the recordsource of the tiny report that should produce the sum
coming up either at the end of report ( in footer of report) or at the end
of the (first) page in footer of page

it actually does produce the correct thing and I can print it out BUT if I
go through the pages page 1 and go to the next one ( for now I have only 2
pages - will be different with more records) I am asked for the criteria
again!!!

the criteria (1. from invoicenumber - 2. to invoicenumber) in reality I
have different names - something german
the crieteria the main report is already produced on .....

I thought that if I use the query that is the source for the report - (1.
from invoicenumber - 2. to invoicenumber) according to user input in a
form -
the subquery could use these two numbers to produce a report query based on
a query that is the underlying recordsource for the main report (fiels are
not linked)

oh dear I am sure there is an easy solution to this problem but I must be
thinking it very difficult and wrong through ....

Gina


Marshall Barton said:
Gina said:
I have a report that's based on a query .... it contains a field amount ....

I would like to have the overall sum of that amount showing up in the
footer - maybe just on the first page.
changing the query to have a sum([amount]) just shows up the value in that
field amount - so not a sum at all.


It's not clear which footer you're talking about here.

A text box in the Report Header/Footer can display the total
of a **field** in the report's record source table/query by
using the expression =Sum(field)
Note that you can not use a control name instead of a field
name.

You can use the identical expression in any Group
Header/Footer to display the total for the group.

You can not use that expression in the Page Header/Footer.

With all that in mind, could you explain, maybe via example,
more about what you are trying to achieve?
 
Gina said:
right now I have a query2 that should do the summing.
field: the amount
table: the query of the main report
function: sum

this is the recordsource of the tiny report that should produce the sum
coming up either at the end of report ( in footer of report) or at the end
of the (first) page in footer of page

it actually does produce the correct thing and I can print it out BUT if I
go through the pages page 1 and go to the next one ( for now I have only 2
pages - will be different with more records) I am asked for the criteria
again!!!

the criteria (1. from invoicenumber - 2. to invoicenumber) in reality I
have different names - something german
the crieteria the main report is already produced on .....

I thought that if I use the query that is the source for the report - (1.
from invoicenumber - 2. to invoicenumber) according to user input in a
form -
the subquery could use these two numbers to produce a report query based on
a query that is the underlying recordsource for the main report (fiels are
not linked)


It apprears that the problem is that you are being prompted
for the invoice number range each time the subreport is
displayed in the main report. This whole issue can be
avoided by getting rid of the query parameter prompts and
using a form to open the report. The form would have two
text boxes for users to enter the FromInvoice and ToInvoice
values and a button that opens the report.

You would then replace the report's record source query's
parameter prompt strings with references to the form text
boxes, e.g. Forms!theform!txtFromInvoice
 
Back
Top