My Assistant
![]() ![]() |
|
|
Mar 3 2012, 05:09 AM
Post
#1
|
|
|
UtterAccess Member Posts: 22 |
Hi All,
I have created an input form for a quote/invoice system, it's a continuous form with what I see as simple calcs within it BUT...it's never that simple. Basically, the form cals the value & qty per line & thats fine, but I cannot get it to ttal all the lines as a "sum". I've attached images showing what i'm doing (wrong i guess) but thought this would work. When I have looked at other sample DB's this does appear to be how it's done, so where have I gone wrong? Any help appreciated
Attached File(s)
page_total.jpg ( 79.19K )
Number of downloads: 28
page_total_error.jpg ( 54.99K )
Number of downloads: 20 |
|
|
|
Mar 3 2012, 05:18 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 7,399 From: Oadby Leics, UK |
qty should be Quantity
|
|
|
|
Mar 3 2012, 06:09 AM
Post
#3
|
|
|
UtterAccess Member Posts: 22 |
cheers Peter,
Both where wrong but you could not see that from the image uploaded. Sure I tried that yesterday along with 1000 other ways incl queries and the like. But sorted thanks |
|
|
|
Mar 3 2012, 08:42 PM
Post
#4
|
|
|
UtterAccess Ruler Posts: 2,670 |
Aggregate Functions, such as Sum(), have to be run against the underlying Fields, not against the Controls displaying the Fields.
As Peter said, you need to replace Qty with Quantity and 'Price' with whatever is the Control Source for the 'Unit Price' Textbox. Your image only shows 'ProductU.' Possibly ProductUntiPrice? Linq ;0)> |
|
|
|
Mar 4 2012, 01:48 PM
Post
#5
|
|
|
UtterAccess Member Posts: 22 |
Aggregate Functions, such as Sum(), have to be run against the underlying Fields, not against the Controls displaying the Fields. As Peter said, you need to replace Qty with Quantity and 'Price' with whatever is the Control Source for the 'Unit Price' Textbox. Your image only shows 'ProductU.' Possibly ProductUntiPrice? Linq ;0)> Thanks for reply So if I understand correctly, if I use =sum([fieldA] * [fieldB]) rather than just [fieldA] * [fieldB] my approach is slightly different? I think I now understand why my now works (see attached) My example "text boxes" use qty & quantity, qty is the the name of the text box & quantity is the control sauce of the text box.
Attached File(s)
|
|
|
|
Mar 4 2012, 08:23 PM
Post
#6
|
|
|
UtterAccess Ruler Posts: 2,670 |
...if I use =sum([fieldA] * [fieldB]) rather than just [fieldA] * [fieldB] my approach is slightly different? Yes. Multiplying the contents of two Controls, in the same, Current Record, can be done using Me.txtFieldA * Me.txtFieldB because they are in the same Record and thus available. You cannot mistake which Record you're talking about; it's the Current Record. But when you're using any of the Aggregate Functions, such as Sun(), you have to use the names of the actual Fields as they appear in the underlying Table. That's because in using Sum(), you're doing calculations that involve Multiple Records, not just a Single Record. Linq ;0)> |
|
|
|
Mar 5 2012, 02:07 AM
Post
#7
|
|
|
UtterAccess Member Posts: 22 |
Thanks Missingling,
Simple & pretty obvious well explianed in such concise detail. I like it here. |
|
|
|
Mar 5 2012, 08:48 AM
Post
#8
|
|
|
UtterAccess Ruler Posts: 2,670 |
Glad we could help!
Welcome to the site! Linq ;0)> |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 26th May 2013 - 01:43 AM |