How do I stop a Procedure off a report from running twice?

  • Thread starter Thread starter Pete Ruby
  • Start date Start date
P

Pete Ruby

I am trying to capture how many times my users print a given report. I put
a procedure on the Reports "On Page" option to add a record to an event
table for the print. The command runs twice - once when the report is
previewed, and once when it is actually printed. If the report is one
record, then the command runs twice.

Also, if the report for each record is multiple pages, does the command run
for every page? ie. if one record is printed, but it is 3 pgs, does it run
3 times?

Thanx
Peter A. Ruby
 
Pete said:
I am trying to capture how many times my users print a given report. I put
a procedure on the Reports "On Page" option to add a record to an event
table for the print. The command runs twice - once when the report is
previewed, and once when it is actually printed. If the report is one
record, then the command runs twice.

Use an event that only executes once. Open or Close would
probably be more appropriate.
Also, if the report for each record is multiple pages, does the command run
for every page? ie. if one record is printed, but it is 3 pgs, does it run
3 times?

Yes, the Page event certainly fires for each page and that
will happen when the report is previewed and again when
printed.

The Format and Print events will also fire more often than
you might expect.
 
Marshall Barton said:
Use an event that only executes once. Open or Close would
probably be more appropriate.

I'm assuming that Open & Close only work on the Preview of a report?

Is there a way to destinguish (sp) if the report is printed or previewed
somehow, ie. in my event that runs whenever Idecide, can I grab if its
running during a preview or print?

Pete
 
Pete said:
I'm assuming that Open & Close only work on the Preview of a report?

Is there a way to destinguish (sp) if the report is printed or previewed
somehow, ie. in my event that runs whenever Idecide, can I grab if its
running during a preview or print?

You can use the report's Activate event, which only fires
when the report is previewed. You'll probably have to set a
module level flag variable and test that in the report's
close event.

Note that because of toner depletion, paper jams, etc, there
is no way to determine if the report actually printed.
 
Back
Top