Text Box addition problem

J

Johnny Bright

Hi there,

I have a text box called InvTot which adds up a total text box on my report
to a text box on a sub form as follows:
=[Total]+[rptUpgrades_sub].[Report]![txtExtTot]
This works great, however, when I try:
=Sum([rptUpgrades_sub].[Report]![txtGSTTot]), that is a text box on my sub
form, I get a "Parameter Value" error.
To make matters worse, when I try:
=Sum([txtInvTot]) in my report's footer section, again I get the parameter
error. What gives?

Any help is greatly appreciated.

Thanks!
 
A

Allen Browne

So txtExtTot is a text box in the Report Footer section of the subreport.
It has a ControlSource of:
=Sum([InvTot])
and correctly shows the total at the foot of the subreport.

You are then transferring that figure back onto the main report. Access
shows the subreport repeatedly throughout the main report, and you are
trying to get a grand total at the end of the main report -- the total of
all the subreport totals.

If that's the idea, you need a text box on the main report in the same
section as the subreport, with these properties:
Control Source = IIf([rptUpgrades_sub].[Report].HasData,
Nz([rptUpgrades_sub].[Report]![txtExtTot],0),
0)
Running Sum Over All
Format Currency
Name txtSubtotalRS
Visible No

Now in the Report Footer section, add the text box to show the grand total.
Set its Control Source to:
=[txtSubtotalRS]

The running sum is what collects the total across the entire report. For an
explanation of the HasData bit, see:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html
 
J

Johnny Bright

Thanks Allen!

That's fantastic, thanks for your help!

John


Allen Browne said:
So txtExtTot is a text box in the Report Footer section of the subreport.
It has a ControlSource of:
=Sum([InvTot])
and correctly shows the total at the foot of the subreport.

You are then transferring that figure back onto the main report. Access
shows the subreport repeatedly throughout the main report, and you are
trying to get a grand total at the end of the main report -- the total of
all the subreport totals.

If that's the idea, you need a text box on the main report in the same
section as the subreport, with these properties:
Control Source = IIf([rptUpgrades_sub].[Report].HasData,
Nz([rptUpgrades_sub].[Report]![txtExtTot],0),
0)
Running Sum Over All
Format Currency
Name txtSubtotalRS
Visible No

Now in the Report Footer section, add the text box to show the grand total.
Set its Control Source to:
=[txtSubtotalRS]

The running sum is what collects the total across the entire report. For an
explanation of the HasData bit, see:
Bring the total from a subreport onto a main report
at:
http://allenbrowne.com/casu-18.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia

Reply to group, rather than allenbrowne at mvps dot org.

Johnny Bright said:
I have a text box called InvTot which adds up a total text box on my
report to a text box on a sub form as follows:
=[Total]+[rptUpgrades_sub].[Report]![txtExtTot]
This works great, however, when I try:
=Sum([rptUpgrades_sub].[Report]![txtGSTTot]), that is a text box on
my sub form, I get a "Parameter Value" error.
To make matters worse, when I try:
=Sum([txtInvTot]) in my report's footer section, again I get the
parameter error. What gives?
 

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

Top