John, thanks for any help, where my credits are showing they are actually
working in running total as debits, I made a debit payment in my credit
payments and it did minus the running total, plus I forgot I will have to
add in [tbOverdueAmount]
I could not find this: running sum property of the textbox to none
Query:
SELECT tblInvoice.OwnerID, tblInvoice.OwnerName, tblInvoice.InvoiceDate AS
OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoice.OwnerName,funGetHorse(tblInvoice.InvoiceID)
& " " & Format(tblInvoice.OwnerPercent,"0.0%")) AS Description,
tblInvoice.OwnerPercentAmount AS AmountSummary, tblInvoice.InvoiceID,
tblInvoice.InvoiceNo,0 AS Flag
FROM tblInvoice
WHERE tblInvoice.OwnerID=Forms!frmBillStatement!cbOwnerName And
(tblInvoice.InvoiceDate Between Forms!frmBillStatement!tbDateFrom And
Forms!frmBillStatement!tbDateTo)
UNION SELECT tblAccountStatus.OwnerID, NULL, tblAccountStatus.BillDate AS
OnDate, tblAccountStatus.ModeOfPayment AS
Description,tblAccountStatus.PaidAmount AS Credit, NULL,BillID,-1 AS Flag
FROM tblAccountStatus
WHERE tblAccountStatus.OwnerID=Forms!frmBillStatement!cbOwnerName And
(tblAccountStatus.BillDate Between Forms!frmBillStatement!tbDateFrom And
Forms!frmBillStatement!tbDateTo);
Ok.
You ignored my suggestion, which WOULD have worked.
Try again:
SELECT tblInvoice.OwnerID, tblInvoice.OwnerName,
tblInvoice.InvoiceDate AS
OnDate,iif(tblInvoice.ClientInvoice=true,tblInvoice.OwnerName,funGetHorse(tblInvoice.InvoiceID)
& " " & Format(tblInvoice.OwnerPercent,"0.0%")) AS Description,
tblInvoice.OwnerPercentAmount AS AmountSummary, tblInvoice.InvoiceID,
tblInvoice.InvoiceNo,0 AS Flag
FROM tblInvoice
WHERE tblInvoice.OwnerID=Forms!frmBillStatement!cbOwnerName And
(tblInvoice.InvoiceDate Between Forms!frmBillStatement!tbDateFrom And
Forms!frmBillStatement!tbDateTo)
UNION SELECT tblAccountStatus.OwnerID, NULL, tblAccountStatus.BillDate
AS
OnDate, tblAccountStatus.ModeOfPayment AS
Description,
-1 * tblAccountStatus.PaidAmount AS Credit,
NULL,BillID,-1 AS Flag
FROM tblAccountStatus
WHERE tblAccountStatus.OwnerID=Forms!frmBillStatement!cbOwnerName And
(tblAccountStatus.BillDate Between Forms!frmBillStatement!tbDateFrom
And
Forms!frmBillStatement!tbDateTo);
Note the difference? There's a -1 * in the Credit calculation. This
will treat the Credit AS A NEGATIVE NUMBER, so that it will subtract
rather than adding.
When I posted this before, I actually meant for you to try it, not
just to look at it and rerun the query which we already know does not
work.
John W. Vinson[MVP]