?
Solved

Form  to show Sum of detail lines

Posted on 2011-03-22
4
Medium Priority
?
306 Views
Last Modified: 2012-05-11
See attached.
Click form frmMainBig.

This shows a single customer (tblCustomers) who is buying 3 products (tblQuoteDetails - see the green bits).

Specifically, note the "line value" in green.

Now look at the orange field at the bottom of the subform.
I want the orange to show the sum of the "line values".

i.e. the Orange should show the sum of the green "line value"
I have tried various options but am unsure of my approach.

All help appreciated!  I hope this is clear.
Database11.zip
0
Comment
Question by:Patrick O'Dea
  • 3
4 Comments
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 2000 total points
ID: 35194902
In your subform, frmQuoteDetails, place a text control in the forms footer.

  Call it txtLineTotal.  Set it's controlsource to:

 =Sum([qty]*[PriceAfterDiscount])

 Now in the main form, set the controlsource for XXSumOrderValue to:

 =Forms![frmMainBig]![frmQuoteDetails].Form![txtLineTotal]

JimD.

0
 
LVL 58
ID: 35194903

 BTW, the text control in the subform can be hidden.

JimD.
0
 
LVL 58
ID: 35194922
Slight correct; the text control in the subform footer needs its controlsource to be:

=Sum([Qty]*([sellprice]*(1-[DiscountPercent])))

JimD.
0
 

Author Closing Comment

by:Patrick O'Dea
ID: 35195042
perfect !

Thankyou!
0

Featured Post

Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

839 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