Connecting Tech Pros Worldwide Forums | Help | Site Map

Report based on Crosstab Query..

Tim Hunter
Guest
 
Posts: n/a
#1: Dec 20 '06
Hi,
I am running Access 2003 on WinXP.
Many of you will think I'm nuts when i explain what I am experiencing. I
have a report that is based on a crosstab query and it works fine. The
user has requested a slight change adding a few different totals at the
end. They should actusall be additional categories but i thought i could
just add some code and pull them out as the report was being poroduced.
I added the code in the ON-PRINT Event and it seemed to work. When I
previewed the report everything looked good. When I print the report the
totals are exactly doubled.
This is happening consistantly and it has happened on two different
computers. It's as if the report is being produced again when it is
printed but the variables are not being cleared. Anybody have any ideas
as to what might be going on?

TIA

Tim Hunter

*** Sent via Developersdex http://www.developersdex.com ***

Frusterated
Guest
 
Posts: n/a
#2: Dec 21 '06

re: Report based on Crosstab Query..


OK, problem solved. This one had me tearing my hair out. This problem
can occur when you use VB behind your reports to hold accumulation
totals. This occured when I previewed the report and found everything
correct but when i printed the report the totals exactly doubled.
The solution is to provide the correct initialization of your variables.
They must be intialized first when the report is opened and then again
when the report is sent to the printer. The names of these two events
are: Report_Open and Report_Page.
I found this answer surfing other sites. I tested it and it works..TIA

Tim Hunter

*** Sent via Developersdex http://www.developersdex.com ***
Closed Thread