Thanks so much for the reply Allen,
My appologies, I don't think I was clear enough.
What I need is a total on the main report.
My situation is:
I have expenses per category, per time period. I also have a budgeted
amount per category per time period. In the source query, I have one
instance
of the budgeted number for every instance of an expence number. So if I
have
3 expenses in one category/time pd, I get 3 budget amounts. So my total
budget per report is 3 times as big as it should be. If I make a sub
report
of the budgeted amount and link it, I only get one budgeted amount per
category/time pd. This works well, except at the moment I can't get a
total
of the budgeted amount on the main report as it is on the sub report.
I think what you told me was how to get a total on the sub report. The
sub
report is on a footer of the category section so it shows up several times
per time period. My totals are per time period (it's a budget report),
and
so I need to total all the various budget results for all the categories
per
time period on the main report.
The text box on the Time Period footer that should hold the total budgeted
amount should look like:
=Sum(All Budget Amounts Shown that reside on the Sub Report)
Thanks again for the help.
Brad
Allen Browne said:
1. Open your subreport in design view.
2. If you do not see a Report Footer section, go to the View menu and
click
Report Header/Footer. Set the Visible property of this section to No if
you
do not want it displayed.
3. In the Report Footer section, add a text box with these properties:
Control Source =Sum([BudgetAmt])
Format Currency
Name txtSumBudgetAmt
4. On the main report, set this Control Source for the text box that
should
show the total:
=IIf([rptBudgetAmt].[Report].[HasData],
[rptBudgetAmt].[Report].[txtSumBudgetAmt], 0)
That assumes the name of the subreport control is "rptBudgetAmt". The
control can have a different name than its SourceObject (the name of the
report loaded into the control).
If there are no records in the subreport, trying to refer to the
non-existent records generates an error. To avoid that, the expression
checks the HasData property.
Thanks for taking the time to read my question.
I have a main report with one small sub report.
I have them linked and it all works fine. The sub report displays one
value
and is placed in the detail section.
I would like to have a total on the main report based on the sub
report.
I have used to builder to create the formula, but it didn't work.
=Sum(rptExpenditures.rptBudgetAmt.Report!BudgetAmt) is what it gave me.
I
am using Access 2003 (XP)
What do I need to fix to get a proper total.
Thanks,
Brad