Referencing Group Footer Calculated Field in Report Group Header

rmoreno

Registered User.
Local time
Today, 11:24
Joined
Aug 26, 2005
Messages
20
I have a report that has a calculated field in a group footer. I would like to reference the value of this calculated field in the group header. When I try to reference this field, using its control name, in the header I get the wrong value. Is there something special I need to be doing to get the correct value.

Almost forgot to mention. The Group Footer control is calculated using Code.

Thank you in advance.
 
When does the "calculation" code run? When do you issue the reference command? Has the value been populated in the footer before the ref. command is issued? Make sure these two activities run in the correct order first...

Do you have a report event that triggers either of these events?
 
The Group Footer control is calculated after the data detail has fully run. This activity seems to work fine. However, when I try to reference this control in the Group Header, I get a value of 1. How would I trigger an update to the Header control after the Footer control has been calculated?
 
The Group Footer control is calculated after the data detail has fully run. This activity seems to work fine. However, when I try to reference this control in the Group Header, I get a value of 1. How would I trigger an update to the Header control after the Footer control has been calculated?
You should just be able to reference it.

What's the code for the footer calculation? And what's the reference code?
 
Here is a zipped copy of the Group Footer control calculations. I copied the original code into a Word document. How would I trigger an update to the Header control after the Footer control has finished calculating its value?
 

Attachments

Here is what I see:

** You have 3 subroutines, which means you have 3 events that fire code.
** You have no function CALLS in your subroutines.
** 3 of your controls are set to the value of "1" at some point
** Group Headers 0 & 1 have On Format events.

Maybe the last point I have made is the problem. Maybe, when you change an actual value in a control in the header section, the program considers that to be a format change. Could that be possible, I wonder??
 
All very valid points. How do you suggest I resolve this problem? I tried referencing the Group Footer control in the Report Header but got the same results as I did when I tried to put the control reference in the Group Header. You mentioned control triggering events. How would I trigger the Group Header control to update after the Group Footer control has finished calculating?
 
Moreno,

I am pretty convinced that the problem lies in the ordering of events. Obviously, the control in the group footer has a value of "1" when you reference it. And, you have 3 subs that set values of various controls to "1". I really can't tell you much more here, because you haven't given me any details about what the sequence order of all of procedures are...

I really feel like I am shooting in the dark. If you want a "guess", put a button on your form, and write something like the following on the click event:
Code:
me.GroupHeaderControl = me.FooterControl
Referencing between controls, regardless of their location on the report, should be that easy...

If you are still getting a value of "1" when doing that, then something else is comming into play here (if your report is not already corrupt, which I don't think it would be).
 

Users who are viewing this thread

Back
Top Bottom