473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Summing problem on report

I have a report-summing problem using Access 2000. When a section runs
over the end of the page, sometimes a detail gets picked up twice.

Example:
Customer Header
XYZ Company
Detail Section (INVISIBLE)
Invoice 1 $100.00
Invoice 2 $250.00
Page Break
Customer Footer
Customer Total $450.00

The bad total is because Invoice 1 is summed twice.

Keep section together does not help. If I make the detail section
visible, then the page fills in a different manner and the problem goes
away. There are no sub-reports on this report

This is a very rare occurrence but I do see it once in awhile. How
should I change my report to solve this?
Hank Reed

Nov 13 '05 #1
7 2157
Hank, how are you calculating this total?

Are you using code in the (Format?) event of the Detail section to
accumulate the total as a variable? If so, drop the code and set the Control
Source property of the Customer Total box to:
=Sum([Amount])

If that does not solve the problem, what is the RecordSource of the report?
Is there anything there that could cause one row to show up multiple times?

If that still does not pin down the issue, check your updates of Access and
JET. Locate msaccess.exe on your hard disk, typically in:
C:\Program Files\Microsoft Office\Office
Right-click the file, and choose Properties.
On the Version tab, if you do not see 9.0.0.6620, go to:
http://support.microsoft.com/gp/sp
and download SP3 for Office 2000.

Just as important, locate msjet40.dll, typically in \windows\system32.
You should see version 4.0.8xxx.0.
The digits at xxx don't matter, but if you don't see the 8, get SP8 for Jet
4 from the same link as above.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Hank" <ha********@aol.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
I have a report-summing problem using Access 2000. When a section runs
over the end of the page, sometimes a detail gets picked up twice.

Example:
Customer Header
XYZ Company
Detail Section (INVISIBLE)
Invoice 1 $100.00
Invoice 2 $250.00
Page Break
Customer Footer
Customer Total $450.00

The bad total is because Invoice 1 is summed twice.

Keep section together does not help. If I make the detail section
visible, then the page fills in a different manner and the problem goes
away. There are no sub-reports on this report

This is a very rare occurrence but I do see it once in awhile. How
should I change my report to solve this?
Hank Reed

Nov 13 '05 #2

Thanks Allen.
No, I have never used VBA for summing in the detail section –
doesn’t work well

Typically, I accumulate totals like this:
Variable Variable
Visible Invisible
IV 1 $100 [IVTotal] [Running] = [IVTotal] Over Group $100
IV 2 $250 [IVTotal] [Running] = [IVTotal] Over Group $350
IV 3 $ 75 [IVTotal] [Running] = [IVTotal] Over Group $425

Section Footer
Total of all Invoices [GrandTotal] = [Running] = $425

This might be replicated over several section groupings: Date, Customer,
Invoice

I believe the recordsource is fine. Remember this only happens on a
page rollover and not very often at that.

I did find msjet40.dll but did not know how to find the version number.
Hank Reed

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #3
Okay, you're using Running Sum. That should work but you could try the text
box with:
=Sum([IVTotal])
or whatever the field name is called.

Right-click the msjet40.dll, and choose Properties.
The 2nd tab of the Properties box is Version.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Hank Reed" <ha********@aol.com> wrote in message
news:uO**************@news.uswest.net...

Thanks Allen.
No, I have never used VBA for summing in the detail section â?"
doesnâ?Tt work well

Typically, I accumulate totals like this:
Variable Variable
Visible Invisible
IV 1 $100 [IVTotal] [Running] = [IVTotal] Over Group $100
IV 2 $250 [IVTotal] [Running] = [IVTotal] Over Group $350
IV 3 $ 75 [IVTotal] [Running] = [IVTotal] Over Group $425

Section Footer
Total of all Invoices [GrandTotal] = [Running] = $425

This might be replicated over several section groupings: Date, Customer,
Invoice

I believe the recordsource is fine. Remember this only happens on a
page rollover and not very often at that.

I did find msjet40.dll but did not know how to find the version number.
Hank Reed

Nov 13 '05 #4
My tests with the Sum function in a report indicate that it will sum a
bound text box but not a text box with a calculated value in it.
For instance, I could sum [Price] or [Quantity] but not sum a text box
named [ExtendedPrice], that held [Price] * [Quantity].

When I set the Control Source to =[ExtendedPrice] is pretends not to
know what text box I'm talking about. The Text Boxes [Price],
[Quantity], and [ExtendedPrice] are all in the detail section.
I want the sum of [ExtendedPrice] in the footer.
Hank Reed

Nov 13 '05 #5
You will need the syntax = Sum([Price]*[Quantity]) here ...

Arno R
"Hank" <ha********@aol.com> schreef in bericht news:11**********************@g14g2000cwa.googlegr oups.com...
My tests with the Sum function in a report indicate that it will sum a
bound text box but not a text box with a calculated value in it.
For instance, I could sum [Price] or [Quantity] but not sum a text box
named [ExtendedPrice], that held [Price] * [Quantity].

When I set the Control Source to =[ExtendedPrice] is pretends not to
know what text box I'm talking about. The Text Boxes [Price],
[Quantity], and [ExtendedPrice] are all in the detail section.
I want the sum of [ExtendedPrice] in the footer.
Hank Reed

Nov 13 '05 #6
Arno's is probably the simplest solution, and should work 100%.

Another solution is to create a query, and put the calculation into the
query as a calculated field, e.g.:
ExtendedPrice: [Price] * [Quantity]
Using the query as the RecordSource for your report, you can then use:
=Sum([ExtendedPrice])

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Arno R" <ar***********@tiscali.nl> wrote in message
news:42*********************@dreader2.news.tiscali .nl...
You will need the syntax = Sum([Price]*[Quantity]) here ...

Arno R

"Hank" <ha********@aol.com> schreef in bericht
ews:11**********************@g14g2000cwa.googlegro ups.com...
My tests with the Sum function in a report indicate that it will sum a
bound text box but not a text box with a calculated value in it.
For instance, I could sum [Price] or [Quantity] but not sum a text box
named [ExtendedPrice], that held [Price] * [Quantity].

When I set the Control Source to =[ExtendedPrice] is pretends not to
know what text box I'm talking about. The Text Boxes [Price],
[Quantity], and [ExtendedPrice] are all in the detail section.
I want the sum of [ExtendedPrice] in the footer.
Hank Reed

Nov 13 '05 #7
I have always known that the sort order in the "Sorting and
Grouping" dialog box takes preference over sorts you may specify on the
report, including sorting the recordset.
I did, however, miss the point that there is a "Keep Together"
choice in "Sorting and Grouping". This takes preference over the
"Keep Together" selection on the properties box for the report section.
Having set "Keep Together" for my Customer section (in the
Sorting and Grouping Dialog), my report totals accurately but I may be
just masking the bigger problem.
Thanks to all,
Hank Reed

Nov 13 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Yaroslav Bulatov | last post by:
I made an array of 10 million floats timed how long it takes to sum the elements, here's what I got (millis): gcc -O2: 21 Python with numarray: 104 Python with Numeric: 302...
3
by: Todd D. Levy | last post by:
I have a query based report where a number of the fields in each record are Yes/No data fields. I would like this report to behave as follows: If ALL of the Yes/No data fields in a given...
2
by: Den | last post by:
I have a report where at the report footer, I have a field that sums up the total of a field in the report. My problem is, when the report is empty the field shows #error. Would someone tell me a...
4
by: John Baker | last post by:
Hi: At the bottom of a report, I wish to sum all the amounts that appear in a field called Discount$ that appears on the report. I am not doing this summing in the query that supports the report...
2
by: Lynn N. | last post by:
I have a report showing Rate, Hours and Total Pay (which is Rate*Hours) for several workers. I want to sum the Total Pay and get a CORRECT figure. This seems like it should be such a simple task....
7
by: SueB | last post by:
Greetings. I have a report based on the following query (hang in there ... it's quite long): SELECT Year(.) AS Yr, tblEvents.eventID, tblEvents.eventname, tblEvents.eventhost,...
4
by: MLH | last post by:
I have a report and on it, a subreport control Main Report Name: rptInvoiceMain Sub Report Name: rptInvoiceSubReport SubReport Control Name: rptInvoiceSubReportCtl The...
0
by: CaptainDahlin | last post by:
Access 2003 Report rptWhiteMailDeposit I have found the "four lines of code" solution to adding sums to page footers and it is working...mostly. (if report is only one page long it doesn't...
4
by: dancole42 | last post by:
So I have an invoicing database based on two main forms: Orders and OrderLines. Orders has fields like: OrderID BillingMethod OrderDate CreditCard CCExp OrdSubTotal ShippingCharge
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.