IMHO you can not rely on index until you tableupdate().
So i suggest that you update a record after either appending
or changing it.
Good luck, Matt.
>In VFP 6, I have a grid with a free table as the recordsouce and table buffering is enabled. The table contains steps to be performed in manufacturing parts. One field is call "step" and is automatically assigned by my program when the user clicks the cmdAdd button. My code calculates the next step number (in increments of 10) and does:
>
>append blank
>replace part_no with thisform.part_no
>replace step with nNext_Step
>thisform.grid1.column2.setfocus()
>
>The index is: part_no+str(step,2,0)
>
>Sometimes, the user might shift-tab to go from column2 to column1, and then change the step number to move it between two existing steps. So let's say the code gave them step number 40, then they changed it to 25 to make this step appear between step 20 and step 30.
>
>However, the grid does not reflect this change until after the new record is tableupdated().
>
>When changing the step number of a record that already existed (i.e. edditing a record, instead of adding a new record), the grid updates (moves the record) immediately, without waiting for a save. This is the desired performance.
A moment of silence is our cosmic reset button.