Hi - I have a form called mainForm that has a subform called subForm. The subform has a numeric field called subCost. There are many subForm records for every mainForm record. On the main form, there is a field called mainCost.
Whenever someone makes a change to the subCost field, I want to populate the mainCost field with the sum of the subCost values. The mainForm and the subForm are joined by mainID = subID.
Here is my lame attempt at writing this myself (on the After Update event of the subCost field).
Any help you can provide would be greatly appreciated.
Thanks in advance,
Bill
Whenever someone makes a change to the subCost field, I want to populate the mainCost field with the sum of the subCost values. The mainForm and the subForm are joined by mainID = subID.
Here is my lame attempt at writing this myself (on the After Update event of the subCost field).
Code:
mainCost = "(SELECT Sum([subCost]) From subForm WHERE [subForm.subID] = [mainForm.mainID)"
Thanks in advance,
Bill
Comment