Solved

Reportheader_format event firing twice?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
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…

895 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

13 Experts available now in Live!

Get 1:1 Help Now