Update header total $ from detail record(s) $ (1 Viewer)

dcavaiani

Registered User.
Local time
Today, 09:12
Joined
May 26, 2014
Messages
385
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.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:12
Joined
Aug 30, 2003
Messages
36,124
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.
 

dcavaiani

Registered User.
Local time
Today, 09:12
Joined
May 26, 2014
Messages
385
I'll give that a try!
 

dcavaiani

Registered User.
Local time
Today, 09:12
Joined
May 26, 2014
Messages
385
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]"
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 07:12
Joined
Aug 30, 2003
Messages
36,124
Happy to help!
 

Users who are viewing this thread

Top Bottom