SELECT VPO.VendorCode, VPOPayment.PaymentID, PaymentID.AccountingReference, PaymentID.PaymentDate, VPO.VPONumber, VPO.OrderDate, VPOItems.ProductID, VPOItems.TotalCost, Sum(nz(vpopayment.VPOAmountPaid)) AS [Amount Paid]
FROM VPO INNER JOIN (PaymentID RIGHT JOIN (VPOItems LEFT JOIN VPOPayment ON...