use of settempvar in a report to print a var value

  • Thread starter Thread starter tdfjr
  • Start date Start date
T

tdfjr

I am new to access and using access 2007.
I want to use a macro and a settempvar line to capture a computed value and
print it at the end of the report.
I can't tell whether the variable ever gets populated, and it doesn't seem
to print.
Thanks.
 
There is a timing issue here. How are you assigning the value to the
tempvar? Will this be complete by the time Access is calculating the end of
the report?

One way around that is to use the events of the report (e.g. the Print event
of the Detail section.) However, even this may fail:

a) The total may be wrong if you don't print all pages. For example, if you
print only pages 4-5, the event may not fire for the records on the previous
pages.

b) The event does not fire at all in Report view (or Layout view.)

You probably need a different approach for collecting these totals, such as
a Running Sum control.
 
Back
Top