473,748 Members | 10,649 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Sum/Rounding issues from subforms

58 New Member
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 3005
MSeda
159 Recognized Expert New Member
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(myPri ce*myMarkUp,2)) will not yield the same result as Round(Sum(myPri ce*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,571 Recognized Expert Moderator MVP
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
11724
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 problematic.
7
4100
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 integer arguments for the components. I am calculating the values using transcendental functions sin and cos which return floating point type values. (The compiler claims they are double though I expected float in, float out.) I guess I have some...
20
4643
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 4 to Service Pack 7 2) Set Subdatasheet Name to from 3) Shortened the file name of the .MDB file 4) Made sure the Track name AutoCorrect info is off
7
1681
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 Subform First subform is a subform of Main Form, and Second Subform is a subform of First Subform.
2
5118
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. But there seems to be rounding issues in Access 2000 that I can't figure out. It seems that, even though the report is displaying Total Pay as currency rounded off to two decimal places, the report is actually using more than two decimal places...
1
2881
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 pivot chart formats. The problem that I'm having is that the Pivot Chart that I've created rounds all of the values down to the nearest integer (e.g., 1.9 is rounded to 1.0, 0.6 is rounded to 0). As you can guess, this is a serious issue when I'm...
5
2742
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
1437
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 rest of the SubReport, or if its shorter it leaves a whopping great white space between Sub components. I have.... tbl-QuoteDetails - this holds the details for the customer - Quote#, name, address etc tbl-Quoteparts - this holds the parts that...
206
13278
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) It then updates the value with numberOfPrecisions after the decimal
0
9370
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9321
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6074
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4602
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4874
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3312
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2782
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.