Code:
UPDATE (SELECT q02PrchsInvcsSub.Coment_IDq, q02PrchsInvcsSub.QuantityA, q02PrchsInvcsSub.PRunTotA FROM q02PrchsInvcsSub ORDER BY q02PrchsInvcsSub.Coment_IDq, q02PrchsInvcsSub.DocumentDateE, q02PrchsInvcsSub.PuinsuID) AS q02PrchsInvcsSubSorted SET q02PrchsInvcsSubSorted.PRunTotA = UpdateRunSum([Coment_IDq],[QuantityA])
The highlighted E needs to be an X, the name of the field in q02PrchsInvcsSub query is DocumentDateX:
DocumentDateX: DLookUp("DocumentDateE","q02PrchsInvcs","PurinvID =" & [Purinv_IDa])
Cheers,