Refering to values of an expression

sullivan

Registered User.
Local time
Today, 15:53
Joined
Apr 24, 2001
Messages
48
In a report, with a subreport, I have created a few controls that refer to values on the subreport. I now want to use those values in other calculations on the main report. First I named each of the controls that are referencing the subreport. Then I tried to use those values to calculate a new value on the main report: =Sum([Total Net]+[Ref Change Net]) The Ref Change Net is the refered control. The report is not recognizing any of these fields. What should I do to use the refered values?
 
This same sort of thing drove me nuts on a report I was working on for some time.
Here's how I eventually did it:

=(IIf([YourSubreportName].[Report].[HasData],[YourSubreportName].[Report]![YourSubReportField1],0))+(IIf([YourSubreportName].[Report].[HasData],[YourSubreportName].[Report]![YourSu breportField2],0)

This this also checks to make sure the field or fields from your subreport are not null (and if they are, returns a zero).

[This message has been edited by RedSkies (edited 05-15-2001).]
 
Thanks RedSkies, the expression works great. Now that my fields are calculating correctly, I need to calculate a grand total at the end of the report. However, this expression does not work with the sum function. Does anyone have any suggestions?
 
I don't know if this is the best way, but it should work:
Create an unbound control in the report detail with a control source of:
=[NameOfCalculateControlCreatedAbove].
Set the Visible property to No and the Running Sum property to Over All.

In the report footer, create another unbound control with the control source
=[NameOfControlInTheAboveParagraph]

Give it a shot and let me know. I might have left something out.
 

Users who are viewing this thread

Back
Top Bottom