Hi All,
I've been working with Access for a while, but am a begginer when it comes to VBA. I have a Contract database, in the ContractDetail Table there is a Contract Start Date and a Contract End Date. In a query based on the table I have two calculated fields: Months (DateDiff between Start and End Date), and Monthly Payment. I need to somehow get a returned recordset that would give me a row for each month between the Start Date and the End Date of the contract and the monthly payment. For Example: Start Date = 04/01/00 End Date = 08/01/00 Monthly Payment = $425
Months = 4
I need to have a recordset that looks like this:
Date Monthly Payment
04/01/00 $425
05/0100 $425
06/01/00 $425
07/01/00 $425
I'm thinking some kind of Do Next Loop that would take the Start Date and add 1 month each time it went through the loop, the number of times it would go through the loop would be based on the number in the "Months" field. The number of months added to the Start Date would also need to be incremented by one for each time it went through the loop. The first time it adds 1 month, the second time 2 months, ect.... I'm thinking this would be stored in a temporary table.
The problem is, I have no idea if this is even possible the way I'm thinking about it!
Can you create recordset like this? Or, is there some really simple way to do this that I'm just overlooking? I'd really, really appreciate any help on where to start with this problem.
Thanks in Advance!
Chanda
I've been working with Access for a while, but am a begginer when it comes to VBA. I have a Contract database, in the ContractDetail Table there is a Contract Start Date and a Contract End Date. In a query based on the table I have two calculated fields: Months (DateDiff between Start and End Date), and Monthly Payment. I need to somehow get a returned recordset that would give me a row for each month between the Start Date and the End Date of the contract and the monthly payment. For Example: Start Date = 04/01/00 End Date = 08/01/00 Monthly Payment = $425
Months = 4
I need to have a recordset that looks like this:
Date Monthly Payment
04/01/00 $425
05/0100 $425
06/01/00 $425
07/01/00 $425
I'm thinking some kind of Do Next Loop that would take the Start Date and add 1 month each time it went through the loop, the number of times it would go through the loop would be based on the number in the "Months" field. The number of months added to the Start Date would also need to be incremented by one for each time it went through the loop. The first time it adds 1 month, the second time 2 months, ect.... I'm thinking this would be stored in a temporary table.
The problem is, I have no idea if this is even possible the way I'm thinking about it!
Can you create recordset like this? Or, is there some really simple way to do this that I'm just overlooking? I'd really, really appreciate any help on where to start with this problem.
Thanks in Advance!
Chanda