Subreport Calculations

Chimp8471

Registered User.
Local time
Today, 23:36
Joined
Mar 18, 2003
Messages
353
in my report called Factory Model, i have a number of subreports.

the 2 i am concentrating on are:

Report.factorymodel_ReportVAT subreport

and

Report.FactoryModel_CIP subreport

in the Report.FactoryModel_CIP subreport

i have to perform a calculation that includes a value from Report.factorymodel_ReportVAT subreport

my calculation is :

Report.FactoryModel_CIP subreport, TotalTime divided by Report.factorymodel_ReportVAT subreport, plannedtime

i have tried writing this loads of ways but keep coming up with nothing....

please can someone help me by saying how this should be written correctly.

cheers

Andy
 
In general, when a report is open, it is a member of the Reports collection of your workspace. Its controls are a member of the Controls collection of the individual report. If you know the name of the control holding the desired value and the name of the report holding that control, you might try something like making the report's target control (where this number goes) have a control source that is

Workspace(0).Reports("FactoryModel_ReportVAT).Controls("TotalTime") ....

Yeah, I know. It's ugly. Whaddaya expect from a Bill Gates product?

Now, part of the problem is that you need to consider WHERE in the report this might occur. In which case you need to consider the SECTION name in which that control appears. (Worse, if the master report needs this value in a section different from the one in which the input values appear, you might have a problem.)

There is always the chance that a cleverly written DLookup or DSum might help, and if your report's structure is complex enough, I'd go that way instead.
 

Users who are viewing this thread

Back
Top Bottom