Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
|
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 October 12th, 2010, 03:56 PM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Default How can I show the Total amount of a subform field amounts

Hello Everyone,

Do you know how to show the total amount of of a subform field amounts in master form?

My Master Form: Project. Fields are ID (primary key, autonumber), projectname, projectmanager, schoolyear...
SubForm: ProjectDetail. Fields are ID (Primary key, autonumber), subobject, Title, EstimatedAmount, descr...
Forms are linked by ID.

I need to put the Total EstimatedAmount as a text box in Master Form below the subform. When EstimatedAmount in subform changes, the Total EstimatedAmount in Master project form has be always changed.

I tried using query, or macro, but it didn't work.

Thanks,
Cindy
 
Old October 12th, 2010, 04:03 PM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

Cindy,

There is no Marco, query or VBA code required to handle this.

What version of Access are you using?

In the Northwind sample database the Orders form does exactly what you want.

This basic idea is this:

1) on the sub form use a hidden form footer with a text box that holds the sum.

2) On the parent form set the control source of a text box to reference the control in the sub form's footer.

Code:
=[Orders Subform].Form!OrderSubtotal
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015
The Following User Says Thank You to HiTechCoach For This Useful Post:
cindyl (October 13th, 2010)
 
Old October 13th, 2010, 09:37 AM
Authorized User
 
Join Date: Sep 2010
Posts: 45
Thanks: 12
Thanked 0 Times in 0 Posts
Smile Thanks, it works

Thank you so much, HiTechCoach!
It works:-).

Cindy
 
Old October 13th, 2010, 10:17 AM
Friend of Wrox
 
Join Date: Sep 2010
Posts: 245
Thanks: 5
Thanked 24 Times in 23 Posts
Default

You're welcome!

Glad we could assist.
__________________
Boyd Trimmell aka HiTechCoach (.com)
Microsoft Access MVP Alumni 2010-2015





Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath Expression to Calculate total amount for order details extkml XSLT 2 November 26th, 2009 11:34 AM
Moving total from Subform to Main Form Shepwad Access 1 March 10th, 2006 10:57 AM
Total Amount display doosti Classic ASP Databases 2 November 14th, 2004 07:25 AM
Filter Subform B Based on Field in Subform A SerranoG Access VBA 3 June 18th, 2004 12:23 AM





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