Solved

MS Access double total when printing

Posted on 2014-10-21
6
311 Views
Last Modified: 2014-10-21
Good afternoon,
I have a problem in the fact that in my BDAccess I have a report create that sum the amount of time.
 This is working fine when I see the report on screen, but when I hit print after it has been look as preview, the Total hours have been double.  The rest of the report is still good, just the total. If I asked it to print without preview, the total is good.

I have searched a couple of days the reason why but I don't find anything.
Maybe you can help me please.

Thanks
code-print-total.txt
0
Comment
Question by:nancytherrien
  • 3
  • 3
6 Comments
 
LVL 34

Expert Comment

by:PatHartman
ID: 40395259
You need to reset the accumulator.  It  accumulates the hours during the preview and then again when Access reruns the report to print it.

Is there some reason you are using code rather than functions to sum the hours.  In the section/report footer, you can add a control with the following control source to sum the data.

=Sum(yourhoursfield)
0
 

Author Comment

by:nancytherrien
ID: 40395295
hello PatHartman,

how do I reset the accumulator ?

The reason I'm doing it by code is that I have to separate mill from office hours and some hours are taken in R et D and some not.

Thanks,
0
 
LVL 34

Accepted Solution

by:
PatHartman earned 500 total points
ID: 40395347
You could probably do what you need to do with expressions as ControlSources but for now, try setting the accumulator to 0 in the print event of the report footer.  You don't actually need to have any controls in the section.  That zeros out the accumulator at the end of the process so it is initialized if the process reruns.  Or, you could use the on format event of the report header and set it to zero at the start of the process.
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:nancytherrien
ID: 40395505
Oh ! my god you are too good.  Thanks I have putted in header print event the txt=0 and it is working.

Thanks a lot.

Nancy
0
 

Author Closing Comment

by:nancytherrien
ID: 40395507
thanks for fast reply.  solution is working just great !
0
 
LVL 34

Expert Comment

by:PatHartman
ID: 40395556
Glad it worked for you.  Been there, done that.  But I remembered the solution:)
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now