Solved

TOTAL FOR A QTY & A CURRECY FIELD IN A SUBFORM

Posted on 1998-01-15
2
298 Views
Last Modified: 2012-06-21
I have a subform within my main form. On the subform I have to fields that I wish to show totals for, a Qty field and a Subtotal(currency)field.  I also needs these results to show on a report.  
0
Comment
Question by:DWB
2 Comments
 
LVL 2

Accepted Solution

by:
BigJ earned 30 total points
ID: 1965693
Say you have a subform of orders for a customer. To calculate the order subtotal, you add a text box to the form footer of the subform and specify an expression in the ControlSource property box for the text box. The expression uses the Sum function. For example, the following expression calculates the total amount for all the products in the Orders form: =Sum([Quantity]*[UnitPrice])

Place the expression that calculates the subtotal in the FORM FOOTER of the subform. The form footer isn't displayed in datasheet view - that's OK.

To display the order subtotal on the main form, create a text box on the main form that uses an expression to refer to the control on the subform that contains the calculated value. For example, you could specify the following expression in the ControlSource property box of the text box on the main form:

=[frmSubForm_name].[Form]![OrderSubTotal_field]

Note: If you want to use the value from a calculated control when computing a total, you can't use the name of the control in the Sum function. For example, if you had a control that calculated quantity * unit price, you'd still have to specify the full syntax =Sum([Quantity]*[UnitPrice]) in the expression.
0
 

Author Comment

by:DWB
ID: 1965694
Cheers, your the greatess
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

910 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now