Solved

TOTAL FOR A QTY & A CURRECY FIELD IN A SUBFORM

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…

758 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

24 Experts available now in Live!

Get 1:1 Help Now