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 2nd, 2003, 05:54 PM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to create a total on a form (using....

...a calculated field in a subform)

Hi All,

Here is the prob I'm facing:
I'm working on a Purchase Order Database and I am trying to create a total of the line items in my subform and have it displayed as a subtotal field on my main form, to which I'll then be able to add such things as Sales Tax & Shipping Cost to get to the Purchase Order's 'Main' Total Amount.

My line item ExtendedTotal field is currently a calculated field: Control Source =[TotalQtyOrdered]*[UnitPrice]

The bottom of Page 859 of the Access 2002 bible (M.R. Irwin and C.N. Prague) - for those of you who can refer to the book - says that I "have to create an additional calculated field on the form I'm using as a subform." However the example in the book was not of a calculated field like mine. Can I still do that? If so, how?

Please help...Muchos gracias!



 
Old October 2nd, 2003, 07:23 PM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maha
Default

Dear Friend,

Make sure your subform's Default View attribute is set to Continous Forms. Make the Form Header and Footer viewable. Insert a field in the footer and insert =Sum([FieldName]) as the Control Source.

If you wish to display the Sum in the Main Form, you must set the criteria in the fields where you select items and quantity for a Purchase Order.

Hope this will assist you.

Thanks,
Maha
 
Old October 3rd, 2003, 09:49 AM
Registered User
 
Join Date: Sep 2003
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maha,

Thank you for the tip. I already did the first part and it's working! :)
Both in 'Continuous Form' and 'Single Form'. The text box I set up in my subform's footer 'Sum of Extended Totals' is calculating the sum of the line items - which is the first step...However, it's not doing my end goal yet, which is displaying it on the main form.

In your reply you said 'If you wish to display the Sum in the Main Form, you must set the criteria in the fields where you select items and quantity for a Purchase Order', can you please tell me what you mean by that? Thanks a lot!

Mita


 
Old October 8th, 2003, 12:48 AM
Authorized User
 
Join Date: Jun 2003
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to maha
Default

Mita,

Sorry for delay in reply to you. Cause, I was away to Northern Region of Malaysia. OK then. If you wish, can I have a copy of the MDB so that I can test and advise you. I don't need whole set of you MDB. Just forward me the relevant table and forms.

Thanks,
Maha





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculate running total on form and prevent text Hughesie78 ASP.NET 2.0 Basics 0 November 27th, 2007 10:35 AM
Calculating total form! require assistance Neeko Java Basics 1 May 4th, 2006 06:48 AM
Moving total from Subform to Main Form Shepwad Access 1 March 10th, 2006 10:57 AM
create form kobystud C# 3 July 5th, 2004 09:13 AM
create query through a form madeira Access 4 September 26th, 2003 06:53 AM





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