Solved

Reportheader_format event firing twice?

Posted on 2004-04-28
6
265 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
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.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 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