Why does Format event repeat

  • Thread starter Thread starter Victoria
  • Start date Start date
V

Victoria

I have code in the OnFormat event in each of my report headers. The code
works fine, but I 'm puzzled as to why it always runs twice in a row. To
understand why the event repeats, I started remming out code lines. Even
when ALL code is removed (see below), the Event always runs twice.

Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As
Integer)
'do nothing
End Sub

What am I missing?

thanks
Victoria
 
Report sections often are "run" many times while a report is being
formatted. ACCESS must continually check for height of sections as data
change in the query's set, as information is put into labels and controls,
etc. This makes it very difficult to do "pass-dependent" code in any report
section when you use a Format event.

Use a Print event for the section; it runs just once for each section.
 
hi Ken - thanks for the explanation. In my case, I don't think the OnPrint
will work because my code involves formatting controls in the report section.
It seems that OnPrint fires only after the formatting is complete but before
printing begins. In any case, I don't mind the OnFormat repeating if that is
its normal behaviour.

Victoria
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top