need help on tracing FormatCount

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Last week, I got an advice from this forum on how to find out the performance
bottleneck of a report.
It suggests adding a debug.print in each on_format event for each section
with this syntax:
Section - FormatCount - TimeStamp(Now())

I have tried the following three ways, but none of them worked.

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
1) got argument is not optional compile error
debug.print Section - FormatCount - TimeStamp(Now())
2) and 3) got sub or function not defined error on Section
debug.print Section(acPageHeader) - FormatCount - TimeStamp(Now())
3)
Debug.Print Reports!Report_rptJJMain.Section(acPageHeader) & "-" &
FormatCount & "-" & timestamp(now())
End Sub

What did I do wrong? And thanks for your help!
 
I don't know what the previous advice was, but the following code will
show the number of seconds between the two points:

dim secs as single
....
secs = timer ' start timing.
.... do things ...
secs = timer - secs ' stop timing.
debug.print "elapsed time = "; secs; " seconds"

HTH,
TC
 
Back
Top