Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / New Users / April 2006

Tip: Looking for answers? Try searching our database.

Adding Subreport totals to Main Report to get Grand Total

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ejike_discuss@hotmail.co.uk - 25 Apr 2006 11:05 GMT
hi
I have created a Report that has totals and within it is a Subreport
that has its own total.
What i want to do now is to add these two sets of totals together to
create a Grand Total but i really do not know how to go about it.

Ive been told that i can use shared variables to do this but ive never
used them before and so do not know how to go about creating them.

Can anyone help this newbie?
Al Camp - 25 Apr 2006 12:31 GMT
  In your subreport, place an unbound calculated control in the report footer that sums
up the subform value. (ex. =Sum(Something)), and call it SubTotalSomething.
  On your Main report do the same for it's value (ex. Sum(Something)) and call it
MainTotalSomething.
  Now add them together on the main ...

       = MainTotalSomething +
Reports!rptYourMainReportName!rptYourSubformName.Report!SubTotalSomething

Signature

hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

> hi
> I have created a Report that has totals and within it is a Subreport
[quoted text clipped - 6 lines]
>
> Can anyone help this newbie?
ejike_discuss@hotmail.co.uk - 25 Apr 2006 13:15 GMT
hi Al

Ive tried what you suggested but now i get two error messages on my
visiostudio report.

the first is 'The value expression for the text box 'textbox18'
contains an error [BC30451] Name Subreport is not declared'

the second is 'The value expression for the text box 'textbox34 '
contains an error [BC30451] Name MainTotalM1 is not declared'
Duane Hookom - 25 Apr 2006 13:14 GMT
It would help if you provided control names. However, try something on your
main report like:
=txtMainReportControlName + subrptCtrlName.Report!txtOnSubrpt
Signature

Duane Hookom
MS Access MVP

> hi
> I have created a Report that has totals and within it is a Subreport
[quoted text clipped - 6 lines]
>
> Can anyone help this newbie?
ejike_discuss@hotmail.co.uk - 26 Apr 2006 11:28 GMT
hi Duane

Tried out what you suggested but this hasnt worked either.

Perhaps if i gave you more info this may help.

On my Subjective Report I have 12 values for each month of the year.
For the first month the value is =sum(Fields! Month_1.Value), and I
have named this text box 'SubRepM1'
The name of the subreport is 'subreport1'.

On my Main Report, again I have 12 values for each month of the year.
For the first month the value is =sum(Fields! Month_1.Value)*-1, and I
have named this text box 'MainRepM1'
The name of the main report is 'GMSHA Budget Adjustment Differentials'

So basically im trying to add up each Month value on the subreport and
main report to provide grand total on the main report.

In the last email you said it would help if I had control names. What
are these and how would i use them.

hope this helps
Duane Hookom - 26 Apr 2006 17:45 GMT
"control names" are what you provided. A text box is a control and it has a
name. You provided the names of your text boxes (controls). Assuming a
subreport named "subreport1" with a text box on it named "SubRepM1", if you
want to reference this value in your main report, add a text box in the same
section of your main report and set its control source to:
  =subreport1.Report.SubRepM1
This will work as long as subreport1 returns records.
Signature

Duane Hookom
MS Access MVP

> hi Duane
>
[quoted text clipped - 19 lines]
>
> hope this helps
ejike_discuss@hotmail.co.uk - 27 Apr 2006 10:46 GMT
hi Duane

Thanks for explaining about control names.

However, I did as you suggested but the visual studio report now shows
the message
'The value expression for the text box 'textbox18'
contains an error [BC30451] Name subreport1 is not declared'

Do i need to declare the report and if so, do you know how i do this.

thankx
Duane Hookom - 27 Apr 2006 20:12 GMT
"visual studio report"? This is a Microsoft Access news group. I would only
expect to see questions regarding MS Access Reports.
Signature

Duane Hookom
MS Access MVP

> hi Duane
>
[quoted text clipped - 8 lines]
>
> thankx
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.