G
Guest
This seems very basic, but I can't do it:
I have a primary table with an autonumber field [Program ID] and a field
called Net_Savings. I have a sub-table [subtblsav] with a field [Savings]
that can have multiple entries linked to each [Program ID] in the main table.
What I want to do (in VBA) is loop through each record in the main table,
use DSum to add up all the [Savings] entries for the current record's
[Program ID], and compare the sum to [Net_Savings] to ensure they're equal.
If they are not equal, I want to update the value of [Net_Savings] to the sum
of the [Savings] for that record.
Any basic suggestions are greatly appreciated. Can you use the record
number in a DLookup function call?
Thanks,
Eric
I have a primary table with an autonumber field [Program ID] and a field
called Net_Savings. I have a sub-table [subtblsav] with a field [Savings]
that can have multiple entries linked to each [Program ID] in the main table.
What I want to do (in VBA) is loop through each record in the main table,
use DSum to add up all the [Savings] entries for the current record's
[Program ID], and compare the sum to [Net_Savings] to ensure they're equal.
If they are not equal, I want to update the value of [Net_Savings] to the sum
of the [Savings] for that record.
Any basic suggestions are greatly appreciated. Can you use the record
number in a DLookup function call?
Thanks,
Eric