Page Header On_Format event (1 Viewer)

Sun_Force

Active member
Local time
Today, 18:45
Joined
Aug 29, 2020
Messages
396
I have several functions and some calculations in the PageHeader's On Format event of a report

If I open the report in acViewNormal & acViewPreview, everything is fine. The functions are executed, the result is as what I expect.
If I open the report in acViewReport, the header is blank. The functions are not executed, the calculations are not done.

My questions:
1- Why in acViewReport, Page Header's on format event is not fired?
2- The assignment asks me to open the form in acViewReport. Is there any other way to run these functions while the report is opened in report view? I've tried report's on open event, but the result is not as I expect.

Thanks.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:45
Joined
Aug 30, 2003
Messages
36,125
1) No idea, but it really caught me out the first time I ran into it
2) try the section's paint event
 

Sun_Force

Active member
Local time
Today, 18:45
Joined
Aug 29, 2020
Messages
396
Million thanks.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:45
Joined
Aug 30, 2003
Messages
36,125
Happy to help!
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 10:45
Joined
Sep 12, 2006
Messages
15,653
Is the OnPaint a new event? I have never used it anyway. As well as OnFormat and on Paint, there is also an OnPrint event.
I found OnFormat and OnPrint did slightly different things as well.
 
Last edited:

Sun_Force

Active member
Local time
Today, 18:45
Joined
Aug 29, 2020
Messages
396
Not sure if it's new or not, but on paint did the magic.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 05:45
Joined
Feb 19, 2002
Messages
43,266
The report view does not paginate. Therefore, not all code will execute. All the code executes in print or Print Preview.
 

Users who are viewing this thread

Top Bottom