I have an update query which updates a master table based on a sub table.
here's the SQL of the update query:
UPDATE tbl_ContractLedger AS C INNER JOIN tbl_CapitalPrs AS P ON C.ContractID = P.ContractID SET C.PRamt = NZ(DSum("Amount","tbl_CapitalPrs","ContractID='" & [C].[ContractID] & "'"),0)
WHERE (((P.[ApprovalCode])="n"));
I thought it was updating fine but then when I erased the data on Capital PR, it says 0 records updated.
For example(tbl_P), contractID=1 | $50
contractID=1 | $50
on tbl_C it should show $100 where contractID=1.
at first it seemed like it's working but when i erased both of those entry (i was expecting $0) i still have $100.
Since it's a DSUM shouldn't it update it to $0?
I know im probably not making much sense but I really can't get this to work. any suggestions?
here's the SQL of the update query:
UPDATE tbl_ContractLedger AS C INNER JOIN tbl_CapitalPrs AS P ON C.ContractID = P.ContractID SET C.PRamt = NZ(DSum("Amount","tbl_CapitalPrs","ContractID='" & [C].[ContractID] & "'"),0)
WHERE (((P.[ApprovalCode])="n"));
I thought it was updating fine but then when I erased the data on Capital PR, it says 0 records updated.
For example(tbl_P), contractID=1 | $50
contractID=1 | $50
on tbl_C it should show $100 where contractID=1.
at first it seemed like it's working but when i erased both of those entry (i was expecting $0) i still have $100.
Since it's a DSUM shouldn't it update it to $0?
I know im probably not making much sense but I really can't get this to work. any suggestions?