need help on tracing FormatCount

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!
 
T

TC

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
 

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

Top