473,322 Members | 1,314 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,322 software developers and data experts.

Sum/Rounding issues from subforms

In the detail of my report I am extracting a sum from a hidden subform via the following:

=IIf([Materials Detail for WO Overview].Report.HasData=True,[Materials Detail for WO Overview].Report!Text19,0)

Where Text19 is the sum of the items in the subform.

I also need a grand total of the Text19's, but because of the conditional statement in the field recieving the result, I can not simply sum them up at the bottom of the report,so I created another subform in my report footer with the exact data, also a Text19, and used (essentially) the same conditional statement.

The problem is the detail and the report footer results are off by pennies due to rounding issues.

Is there a better way to do this? What about an SQL statement which sums the data so I can completely lose both of my messy subforms and the conditional statements??????

Thanks in advance for any help provided.
Mar 8 '07 #1
2 2984
MSeda
159 Expert 100+
There is definitely a better way to do this. If you can post a better description of what you want to do in the report as well as describing the underlying tables/queries I'm sure we can find a way to do what you want with out hidden forms.
The fact that your Grand Total does not match the sum of the of the detail fields suggests that you are not rounding your currency values in a consistent manner. I generally avoid saving any currency value in a table that has more than two decimal places. By rounding immediately after performing any calculation that might yield a product with more than two decimal places like when multiplying by a percentage.
Sum(Round(myPrice*myMarkUp,2)) will not yield the same result as Round(Sum(myPrice*myMarkup),2). I prefer the former as it rounds the number immediately after the additional decimal places were acquired. The latter is not necessarily wrong but could potentially cause a discrepancy if you are not meticulous about how and when you use it.
Setting the data type to currency does not automatically round to two decimal places.
Anyway post back the stuff I mentioned at the top and we'll see if we can get your report working.
Mar 9 '07 #2
NeoPa
32,556 Expert Mod 16PB
I'm sure MSeda knows this, and will suggest it if it's required when your requirements are more clearly known, but there is a property on a TextBox within reports called 'Running Sum' which can be used to tally up totals in reports.
Mar 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

20
by: Raoul Watson | last post by:
By any chance, anyone got a rounding routine that does a work around the VB "round" bug? I still find it amazing that a company as large as Microsoft would put out a math package that is so...
7
by: Steven T. Hatton | last post by:
I'm surprised I haven't hit this situation till now, but I don't believe I've had to deal with it before. I have a function that sets the components of a point class (QPoint from Qt). It takes...
20
by: John | last post by:
Hi, I've recently upgraded from Access 97 to Access 2002 & the performance basically stinks. I have tried the following items listed below but it has only had a minor impact: 1) Upgraded Jet...
7
by: Julia Baresch | last post by:
Hi everyone, My company recently upgraded from Office 97 to Office XP. As those who've read my other posts know I have a database with 3 nested subforms Main form-->First Subform-->Second...
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....
1
by: keliie | last post by:
Hello, I've created a form that contains a single unbound combo box and two subforms. The two subforms display the results of a query (driven by the combo box selection) in both tabular and...
5
by: Cygnus | last post by:
Sorry in advance for the lack of formatting in this posting. Data: (column headers) Net Sales | Royalty Rate | Total Royalty (data) 4.31 | 50.00% | 2.15 19.35 | 50.00% | 9.68
3
RobH
by: RobH | last post by:
I need to make a quotation report which will need to bring in different subForms/Reports. The problem I have is that if the content of the subform is longer that the area allocated it truncates the...
206
by: md | last post by:
Hi Does any body know, how to round a double value with a specific number of digits after the decimal points? A function like this: RoundMyDouble (double &value, short numberOfPrecisions) ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.