I have a Purchase Order form with a a subform that has POline item details (ProductID, Quantity, Unit Cost, and extended Cost (calculated). I want to sum the list of ExtendedCosts which are on a subform to display total PO cost. I also want that sum toupdate as I add line items.
My PO main form is 90% similar to Northwinds Order DetailsForm which allows the user to add items to a Purchase Order. However Northwindsdoes not sum the extended costs to display the total Purchase Order costs.
I have tried two things
1. Ieither get a #error if I try to do the sum in a text box on the main form, or
2. WhenI wrote a query to use on a second subform which had a single field whichdisplayed the PO total, I got the total costs but I can’t get the total toupdate either when a new line item extended costs are calculated or when I makea change in one of the PO Line Items. I tried the following with limitedsuccess
Code:
Private Sub Form_AfterUpdate()
Code:
Me.Parent!POTotalChild28.Form.Requery
End Sub
Now the subform will update to thecorrect total if I change records or place focus on the main form. The user prefersto see the new total immediately.
Any ideas?