Summing totals and displaying in subforms

Christine Pearc

Christine
Local time
Today, 00:53
Joined
May 13, 2004
Messages
111
I'm having difficulty getting results of a query, and hope someone can assist.

Query A pulls together data from a table.

Query B summarises the info from Query A. Here's a sample column:
Field: Pending Review: PendingReview
Table: qryA
Total: Sum

Form A contains a Form B (set to continuous) to show results from Query B.

Here's what it looks like thus far:

FORM A - MAIN FORM
Main form stuff (switchboard stuff)

FORM B (SUBFORM)
PendingReview Overdue Total <-heading
Engineering 10 3 13 <-detail
Purchasing 2 1 3

Now it needs column totals to show the total PendingReview, TotalOverdue, etc. To do this, I wrote QryC. Here's a sample column:
Sum Of Pending Review: Sum(QryB.[Pending Review])

What I can't figure out, is how to get the results of QryC into the footer of the Form B. I tried creating an expression to put the results into Form B's footer, but that didn't work. Creating a form to put the results into Form A won't work either, but for esthetic not technical reasons. I tried creating Form C to place it into Form B's footer, but that doesn't work either.

Perhaps the problem is QryB, and not a form issue at all. I'm confused! This SHOULD be so simple! Here's how it all should look:

FORM A - MAIN FORM
Main form stuff (switchboard stuff)

FORM B (Subform, continuous - data from QryB)
PendingReview Overdue Total <-heading
Engineering 10 3 13 <-detail
Purchasing 2 1 3
-------------- -------- -----
TOTAL 12 4 16 <-data from QryC


Help will be greatly appreciated!
 
I think you are making this too complicated. I don't believe you need query C. Just sum your query B fields. For example: Sum([pendingreview]).
 
Hope this helps

I kind of had the same problem.

What I did to overcome this was
create an unbound box in my form.
Then use the below code in the control source

=[name_of_subform].Report![name of field]

Hope this is of someuse
also remove the [ or ] parts if no spacing is in your table/form names etc
 

Users who are viewing this thread

Back
Top Bottom