Solved

Form  to show Sum of detail lines

Posted on 2011-03-22
4
267 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 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 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 57
ID: 35194903

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

JimD.
0
 
LVL 57
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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 - Labels prompt to print 4 31
Ms Access VBA Variables 6 28
SQL multicriteria from ONE textbox 32 43
SetFocus doesn't wait for input 14 33
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 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