If your goal is to get the remaining balance by vendor, then it would probably be simpler to use the second table in the main report to distinguish invoice and credit amounts.
If your goal is to display all invoices, followed by all credits, per vendor, then the subreport is the way to go. You would then place the subreport in the group footer section for vendor ID and then link the subreport on the vendor ID. You could insert summaries on the credits per invoice and also insert a grand total. Then you could set the grand total to a shared variable so you can use it in the main report, as in:
whileprintingrecords;
shared numbervar allcr := sum({table.creditamt});
You would place this on the subreport report footer, and then in the main report, in a section below the one in which the subreport is located, you would create a formula like the following:
whileprintingrecords;
shared numbervar allcr;
sum({table.invoiceamt},{table.vendorID})-allcr
You would also need to add a reset formula in the main report vendor header:
whileprintingrecords;
shared numbervar allcr := 0;
If your amounts are of currency datatype, then change "numbervar" to "currencyvar".
-LB