Solved

Reportheader_format event firing twice?

Posted on 2004-04-28
6
261 Views
Last Modified: 2008-02-01
I have a report that has a query with a parameter as a recordsource.  I want to pass the parameter value to another sub function and I am using the reportheader_format event to capture and pass the parameter.  Everything seems to be working except that the reportheader_format event appears to be firing twice.  What triggers this event? Why is it firing twice on opening of report?

Any help is appreciated.

Rene'
0
Comment
Question by:rhdeleon
6 Comments
 
LVL 4

Expert Comment

by:davidW
ID: 10945870
rhdeleon

When you say the event is firing twice do you mean the parameter is asked for twice
0
 

Author Comment

by:rhdeleon
ID: 10945888
No, I think I kinda figured it out.  I have a subreport on the report and it appears that the reportheader_format event is firing for both the report and the subreport.  Does this sound right?  Anyway, I think I've got it working.

Thanks,

Rene'
0
 
LVL 54

Accepted Solution

by:
nico5038 earned 200 total points
ID: 10946662
Hi Rene,

Access will sometimes process the data twice when building a report.
This is because you're allowed to put e.g. a total in a header. Thus all data needs to be processed to get the total, but as you can display it "before" the detail data has been read, there's always a first "cycle" for the calculation of the totals and then the detail lines are printed.
For this Access has the FormatCount property. Just open the OnFormat of your Detail section, select the FormatCount and press F1 to see in the helpfile the whole story.

Nic;o)
0
 
LVL 57
ID: 10952756
In Addition to what Nico said, Access will also execute the OnFormat of a section several times if it needs to retreat up the page based on settings for grouping, etc that you have set (i.e. Keep Together).

Jim.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now