Greetings All,
I am writing a billing and invoice program. I want to create a query that retrieves the previous month's balance for a given client so that I can include it on the current month's invoice. Here's my setup so far, which works just fine for the current invoice total:
tblInvoice:
PK idxInvoice (AutoNumber)
nfldidxClients (Number)
dfldDate (Date/Time)
nfldInvoiceNumber (Number)
dfldStartDate (Date/Time)
dfldEndDate (Date/Time)
qryTotalInvoice:
Field: idxInvoice
Table: tblInvoice
Criteria: [Forms]![frmInvoice]![txtidxInvoice]
Field: dfldStartDate
Table: tblInvoice
Criteria:
Field: TotalInvoice: [qryTotalMonthlyHourlyCharges]![SumOfAmount]+[qryTotalMonthlyExpenses]![SumOfcfldExpnsAmount]-[qryTotalMonthlyPayments]![SumOfcfldPymtAmount]
Table:
Criteria:
So far, so good. All of the calculations are done using idxInvoice. How can I call upon the figure returned by [qryTotalInvoice]![TotalInvoice] and put it into the Previous Balance field on the next month's invoice? I can't seem to get around the fact that next month's invoice has a different idxInvoice value. Do I need to append the [TotalInvoice] figure to a PreviousBalance table? I was hoping not to save a calculated value for accuracy's sake.
Any help would be most appreciated.
I am writing a billing and invoice program. I want to create a query that retrieves the previous month's balance for a given client so that I can include it on the current month's invoice. Here's my setup so far, which works just fine for the current invoice total:
tblInvoice:
PK idxInvoice (AutoNumber)
nfldidxClients (Number)
dfldDate (Date/Time)
nfldInvoiceNumber (Number)
dfldStartDate (Date/Time)
dfldEndDate (Date/Time)
qryTotalInvoice:
Field: idxInvoice
Table: tblInvoice
Criteria: [Forms]![frmInvoice]![txtidxInvoice]
Field: dfldStartDate
Table: tblInvoice
Criteria:
Field: TotalInvoice: [qryTotalMonthlyHourlyCharges]![SumOfAmount]+[qryTotalMonthlyExpenses]![SumOfcfldExpnsAmount]-[qryTotalMonthlyPayments]![SumOfcfldPymtAmount]
Table:
Criteria:
So far, so good. All of the calculations are done using idxInvoice. How can I call upon the figure returned by [qryTotalInvoice]![TotalInvoice] and put it into the Previous Balance field on the next month's invoice? I can't seem to get around the fact that next month's invoice has a different idxInvoice value. Do I need to append the [TotalInvoice] figure to a PreviousBalance table? I was hoping not to save a calculated value for accuracy's sake.
Any help would be most appreciated.