Solved

TOTAL FOR A QTY & A CURRECY FIELD IN A SUBFORM

Posted on 1998-01-15
2
304 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

806 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