?
Solved

Reportheader_format event firing twice?

Posted on 2004-04-28
6
Medium Priority
?
271 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
4 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 800 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 58
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses
Course of the Month14 days, 13 hours left to enroll

839 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