Wrox Programmer Forums
|
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2004, 07:14 PM
Authorized User
 
Join Date: Nov 2003
Posts: 43
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to bjackman Send a message via MSN to bjackman
Default Totals

I have a subform that holds information for a PO database. It has qty, unitprice, description and Amount. Amount is the total of qty * unitprice. Is there a way on the main form to get a textbox named totalamount to display the sum of the amount from the subform. So if the sub has 2 records totaling 70 dollars, the total amount control on the main fomr displays it. Thanks in advance for any hlp.

 
Old February 8th, 2004, 09:27 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes. just create another textbox and type the following inside the textbox itself on the subform:

=NZ(qty)*NZ(unitprice)
let's say that this textbox name is "totalamount".

The NZ creates a value of 0 if any of the two textboxes is null.

Create another textbox on the footer of the subform Let's say you call it "grandtotal" and type the following inside of the textbox:

=Sum(totalamount)

Then set it to hidden (no need to do it if you are showing it as datasheet). Then open the main form and create another textbox and use the expression builder to give it the value of "grandtotal" of your subform.





Sal





Similar Threads
Thread Thread Starter Forum Replies Last Post
Totals not working rsm42 ASP.NET 1.0 and 1.1 Basics 1 December 20th, 2006 06:55 AM
Help with totals rsm42 ASP.NET 1.0 and 1.1 Basics 0 December 15th, 2006 01:18 PM
Totals not accurate! dba123 Reporting Services 1 February 5th, 2006 10:53 PM
Grouping and totals btado XML 4 July 1st, 2005 03:08 AM
Grouping and totals btado XSLT 3 June 22nd, 2005 01:08 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.