Go Back   Access World Forums > Microsoft Access Discussion > Theory and practice of database design

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 05-29-2015, 02:32 PM   #1
dcavaiani
Newly Registered User
 
Join Date: May 2014
Location: Appleton, WI
Posts: 268
Thanks: 174
Thanked 10 Times in 10 Posts
dcavaiani is on a distinguished road
Update header total $ from detail record(s) $

What's the trick to get a grand total in the header UPDATED from the sum of all the detail lines entered into the linked detail records. If you have 3 detail records with 100 dollars each, then the header should be updated with the grand total of 300 dollars.

dcavaiani is offline   Reply With Quote
Old 05-29-2015, 02:37 PM   #2
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,286
Thanks: 13
Thanked 4,111 Times in 4,043 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Update header total $ from detail record(s) $

The trick is not to try and store the total, just calculate it from the detail as needed. If you must, probably code in the after update event of the subform to use DSum() to populate the main form.
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
The Following User Says Thank You to pbaldy For This Useful Post:
dcavaiani (05-29-2015)
Old 05-29-2015, 04:54 PM   #3
dcavaiani
Newly Registered User
 
Join Date: May 2014
Location: Appleton, WI
Posts: 268
Thanks: 174
Thanked 10 Times in 10 Posts
dcavaiani is on a distinguished road
Re: Update header total $ from detail record(s) $

I'll give that a try!

dcavaiani is offline   Reply With Quote
Old 05-30-2015, 08:57 AM   #4
dcavaiani
Newly Registered User
 
Join Date: May 2014
Location: Appleton, WI
Posts: 268
Thanks: 174
Thanked 10 Times in 10 Posts
dcavaiani is on a distinguished road
Re: Update header total $ from detail record(s) $

I have the Dsum logic figured out, but not sure how to get just the detail records from the subform calculated into the Main form - for just the matching record numbers:

Trying:

...dsum ..."[recordid]=[Forms!SupplierInvoiceHdr.[recordid].value]"
dcavaiani is offline   Reply With Quote
Old 05-30-2015, 09:10 AM   #5
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,286
Thanks: 13
Thanked 4,111 Times in 4,043 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Update header total $ from detail record(s) $

This help?

http://access.mvps.org/access/general/gen0018.htm
__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
The Following User Says Thank You to pbaldy For This Useful Post:
dcavaiani (05-30-2015)
Old 05-30-2015, 09:18 AM   #6
dcavaiani
Newly Registered User
 
Join Date: May 2014
Location: Appleton, WI
Posts: 268
Thanks: 174
Thanked 10 Times in 10 Posts
dcavaiani is on a distinguished road
Re: Update header total $ from detail record(s) $

Thanks, that does it!
dcavaiani is offline   Reply With Quote
Old 05-30-2015, 09:20 AM   #7
pbaldy
Wino Moderator
 
pbaldy's Avatar
 
Join Date: Aug 2003
Location: Nevada, USA
Posts: 33,286
Thanks: 13
Thanked 4,111 Times in 4,043 Posts
pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold pbaldy is a splendid one to behold
Re: Update header total $ from detail record(s) $

Happy to help!


__________________
Paul
Microsoft Access MVP 2007-2019

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
pbaldy is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Group Header and Detail bbulla Reports 1 10-28-2014 08:02 PM
Header and Detail Query jagloha Queries 2 07-01-2008 11:04 PM
Header & Detail Keys Zak01704 Queries 1 04-22-2008 05:45 AM
master detail record deletion problem in detail record rashidzaib Forms 2 08-12-2007 09:07 PM
Continuous Tab Header to Detail Jodi_MHS Forms 1 12-07-2001 11:17 AM




All times are GMT -8. The time now is 01:54 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World