Calculated field based off sum of other fields
Any help is greatly appreciated!
I have two tables like so:
Tb1:
AutoNum |
Agreement |
SubAgreement |
Value |
ValueLeft |
1 |
Agree1 |
Sub1 |
$10 |
|
2 |
Agree1 |
Sub2 |
$15 |
X |
3 |
Agree2 |
Sub1 |
$8 |
|
4 |
Agree2 |
Sub2 |
$17 |
|
Tb2:
AutuNum |
InvoiceNum |
Agreement |
SubAgreement |
AmountBilled |
1 |
1234 |
Agree1 |
Sub2 |
$4 |
2 |
5678 |
Agree1 |
Sub2 |
$3 |
My question is, how do I get X in Tb1.
The value of X should be "X = $15 - $4 - $3"
[ValueLeft] needs to look at Tb2 where [Agreement] and [SubAgreement] equals [Agreement] and [SubAgreement] in Tb1 and subtract all [AmountBilled] values from [Value].
These tables are displayed in a form.