>Actually, saving the balances in the detail lines sounds like the best solution I've heard. I can't just calculate it; I have to store it somewhere. And this way I'd have the balance as of any point.
>
Michelle,
You are making your current problem worse if you do that. How will you deal with a change to an invoice somewhere in the middle of the list? Are you going to recalculate all of the past balance fields in all later invoices to fix them?
You can calcualte the data when you need it. If you can't, then it is time to drop way back to the design of the tables and find out WHY you can't calculate the balance for a customer. Goping any further with producing invioces when the tables don't have the necessary details will not only be fruitless, but it will drive you crazy.
Why not post the structures of the tables you are using with some description of them and we can see if we might have ideas to make them more suitable to your goals?