[AccessD] Referencing Report Footer Calculated Field in ReportHeader

David Emerson newsgrps at dalyn.co.nz
Wed Feb 13 21:22:15 CST 2013


Thanks for the help Jim.

The report already has the pages property in the report footer.

When I check the value of the Grand Total on the report footer it only
includes the first subreport item amount plus the two batch amounts on the
first pass.  This is the value being put into the header grand total field.
The second pass puts the correct value into the footer Grand Total field.

If it is a timing issue then it seems that the report header is being
formatted before the report footer (as would be expected) and so is not
getting the correct value.

What I may need to do is create a query that calculates the value separately
and put this in rather than using other fields from the report.

Regards

David Emerson
Dalyn Software Ltd
Wellington, New Zealand





-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim Dettman
Sent: Thursday, 14 February 2013 3:31 p.m.
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Referencing Report Footer Calculated Field in
ReportHeader


 You'll need to turn on 2 pass printing by referencing the pages property in
a control.

  On the first pass (which doesn't print), you can grab the total in the
report footer and hold it in a variable, then print it in the report header
on the 2nd (print) pass.

  The basic technique is outlined here:

http://support.microsoft.com/kb/841779

One other trick; you can tell your on the first pass by testing the pages
property, which will be 0.

Also be aware that the OnPrint event is not fired on pass one.  Any code you
need should be in the OnFormat event.

Jim. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of David Emerson
Sent: Wednesday, February 13, 2013 07:27 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Referencing Report Footer Calculated Field in
ReportHeader

The reason for putting it at the top as well as the bottom is because the
report may have several pages.  The client wants to see the total on the
front page along with other information for easy transfer to another system.

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Thursday, 14 February 2013 12:35 p.m.
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Referencing Report Footer Calculated Field in Report
Header

Maybe I'm missing your point, but why would you want to show the grand total
in the report header?  Reports are band-generated, so the data hasn't been
compiled yet at that point unless you create a special function to repeat
all your calculations.  That doesn't make sense to me.

Charlotte

On Wed, Feb 13, 2013 at 2:51 PM, David Emerson <newsgrps at dalyn.co.nz> wrote:

> Team,
>
> I have a batch report which has a subreport of items in the batch and 
> amounts.  On the footer of the main report is a Grand Total of the 
> subreport items as well as a couple of batch amounts.  This works 
> fine.
>
> Here is the control source for the fields:
> = srpOrderDetailPrice!txtTotalCost +
> [txtBaseSetTotal]+[txtFolderLabourTotal]
>
> I would like to show the Grand Total on the report header as well.  
> When I put the formula in the report header section it only includes 
> the first subreport item amount plus the two batch amounts.
>
> It looks like a timing issue.  How can I get the report header field 
> to equal the report footer field amount?
>
> Regards
>
> David Emerson
> Dalyn Software Ltd
> Wellington, New Zealand



More information about the AccessD mailing list