Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MS Access double total when printing

Posted on 2014-10-21
6
Medium Priority
?
356 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:Nancy Therrien
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 39

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:Nancy Therrien
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 39

Accepted Solution

by:
PatHartman earned 2000 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Nancy Therrien
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:Nancy Therrien
ID: 40395507
thanks for fast reply.  solution is working just great !
0
 
LVL 39

Expert Comment

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

671 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