Matt, since we both agree that a table/row should be updated before index can work we have to accept it as a precondition.
So i take a couple of steps back (to be on a safe distance) and tell you -- reconsider and then rewrite the whole procedure.
First of all i would switch to optimistic row buffering. Then i would let the user to add and (if nessesary edit) a new record and then to Save/Cancel the operation. All this requeres careful tuning of the grid. For example before moving to another record the BeforeRowColChange method should determine the state of the current record (added or eddited)and take appropriate actions and so on.
Best wishes.
>Yes, that would work, but... what If the user would revert out of the newly added record? Since I would have done tableupdate(), the record would exist in the table, and I would have to delete it, and this action could leave a lot of deleted records in the table. I have found that reverting out of an add procedure is pretty common when adding line items to a table.
A moment of silence is our cosmic reset button.