>
>In most cases, a printed report where I want multiple invoice totals in a row.
>
That could be one query, that returns a list of those totals.
>If I have unsaved changes, loading the data in a separate cursor won't give the correct results. And if I always reload the current cursor, I've lost those changes. Sergey's suggestion seems... too simple, but I'll give it a try.
>
The function I posted was not for querying the currently loaded invoice, so unsaved changes aren't a problem. Isn't getting totals for a report a different scenario than totalling an invoice that is currently being edited? That's why I'd suggest a SQL SELECT query for reporting purposes.
But based on the information you've given, Sergey's idea will work. I almost went that direction in the function I gave you.
Steve Gibson