Jim Dettman
jimdettman at verizon.net
Wed Feb 13 20:30:45 CST 2013
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 -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com