Thanks Pat for your feedback. Ack.
In fact, I have 4 tbls: tblJobInfo, tblTaxNumber, tblInvoiceNumber, tbleCharge and its relationship as attached pix.
JobNumber is unique in this database. A same TaxNumber can be appeared in different JobNumber(s). A TaxNumber include different unique InvoiceNumber. The value of each InvoiceNumber will be calculated in tblCharge. It works so far.
Today, I have a request as following:
(1) to list all InvoiceNumber records (and its $ amount) of a TaxNumber: it be done by query;
(2) customer (determine by TaxNumber) will pay for their Invoices in several time with certain $ amount (TaxPayAmt);
(3) Accountant will divide these paid amounts (TaxPayAmt) into different invoices until the invoice fully paid (InvPayAmt); sum(InvPayAmt) at a time would be shown and equal to each TaxPayAmt;
(4) Each TaxPayAmt has an unique TaxPayID
(5) Each InvPayAmt could be linked back to the TaxPayID for the report purpose
How can I create a form which contents:
(a) TaxNumber, TaxPayID, TaxPayDate (input), TaxPayAmt (input)
(b) Subform contents: InvoiceNumber, Total, DebitCredit (query from existing db), InvPayAmt (input), Diff (=Total - sum(InvoicePayAmt)); only the Invoice record with Diff>0 will be displayed.
Thanks to advise, Pat.
//Quan