Where does the #Error occur?
To solve this, temporarily eliminate the later boxes (GrandTotal and
txtDeptTotalRS) until you get the others working.
Does the subreport's txtDeptTotal show correctly?
If so, does JobTotal on the main report being it back correctly?
If there could ever be a category that has no expense, you might want to
use:
=IIf([subrptJOBEXPENSE].[Report].[HasData],
Nz([subrptJOBEXPENSE].Report].[txtDeptTotal], 0), 0)
Explanation:
http://allenbrowne.com/casu-18.html
Once that's working, txtDetpTotalRS should work.
And then GrandTotal should work.
If it's still broken, indicate which text box in the queue is the one
that
fails.
(Note that if you don't eliminate the later ones, the #Error can occur in
several places, and you don't know the critical point. Once Access is
unable
to calculate a calculated control, is shows #Error for the others as
well.)
On Apr 26, 10:21 pm, "Allen Browne" <
[email protected]>
wrote:
See:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html
If you also need a grand total in the Report Footer of your main
report,
get
the above working, and then add a 2nd text box to the same section as
your
subreport. Assuming the text box that shows the dept total from the
subreport is named txtDeptTotal, set these properties for the 2nd text
box:
Control Source =[txtDeptTotal]
Running Sum Over All
Format Currency {or General Number if you
prefer}
Visible No
Name txtDeptTotalRS
Now you can add a text box to the Report Footer section, and get it to
show
the grand total by setting its Control Source to:
=[txtDeptTotalRS]
--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users -http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
I have a Main report
Grouped by Month
Then Grouped by Department...
I have a Subreport in the Department group header of my Main report.
The Subreport is grouped by Job
and all the Expenses for the job are in the details.
I have a Total in the report footer of my sub report.
My question:
How do I get the Total from my Subreport to my Main report,
calculating all the Expenses by Department?
Any and all help much appreciated.- Hide quoted text -
- Show quoted text -
I have tried your method and I get the #Error
Here is my report structure...
MAIN REPORT = [rptMONTHLYBILLBACKS]
--Report Header---------------
--Page Header-----------------
--DueDate Header--------------
[Month] =Format([dbo_RB_JOB.DUEDATE],"mmm"", ""yyyy")
--Department Header-----------
[Department]
--JobID Header----------------
JobID
JobName
Categoryname
====SUBREPORT = [subrptJOBEXPENSE]===================
--Report Header---------------
--Page Header-----------------
--JobID Header----------------
--Detail----------------------
Vendor
Categoryname
Quantity
Unitcost
Totalcost
--JobID Footer--------------------
[TOTAL] =Sum([QUANTITY]*[UNITCOST])
--Page Footer------------------
--Report Footer----------------
[txtDeptTotal] =Sum([QUANTITY]*[UNITCOST])
=====================================================
[JobTotal] =subrptJobExpense.Report!txtDeptTotal
[txtDeptTotalRS] =[JOBTOTAL]
--Detail----------------------
--JobID footer-----------------
--Department Footer------------
[GrandTotal] =[txtDeptTotalRS]
--DueDate Footer---------------
--Page Footer------------------
--Report Footer----------------
Am I putting the txtboxes in the correct section?
I am sorry for not getting this quickly, I am very new to Access
Thanks for your help- Hide quoted text -
- Show quoted text -