Solved

Reportheader_format event firing twice?

Posted on 2004-04-28
6
264 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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

809 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