How to calculate SUM() from subReport to Mainreport

AccessFreak

Registered User.
Local time
Today, 22:15
Joined
Feb 19, 2009
Messages
69
I have 2 subreports in my detail section. In the footer of each subreport I have a number exclusive VAT. That works BUT.. read on.

The total of both have numbers need to be calculated to the mainreport.

This is called the Total exclusive VAT. That doesn't work... It says cant find the controls on the subreport.

Under the Total Exclusive VAT there need to be a Total Inclusive VAT.

The statement I used for the control in the subreport is:
= Sum([Time]*[Price])

The statement I used for the control in the Mainreport is:
= Sum ([Subreport_Taken].[Report]![txt_TotalExclVAT]+[Subreport_].[Report]![txt_TotalExclVAT])

The second doesn't work...
 
Use the HasData method, examples have been posted here
 
I don't fully understand the problem.
However it seems you should simply be adding the two controls from the subforms.

Moreover Sum() applies to the fields in the RecordSet of the form not the controls on the form. You can't Sum controls as they only contain the value of the current record.
 

Users who are viewing this thread

Back
Top Bottom