This is a known VFP bug (versions 5 and 6, don't know about Version 7). To avoid this I usually use two cursors and when I delete a record from the main cursor copy all the records to the second cursor except the deleted one. I then append back the records to the original cursor.
Set Deleted on
Create cursor cursor1 (Code c(6), description c(10))
Create cursor cursor2 (Code c(6), description c(10))
Select Cursor1
Delete
Scan
Scatter to memvar
Select Cursor2
Append Blank
Gather from memvar
EndScan
Zap
Select Cursor2
Scan
Scatter to memvar
Select Cursor1
Append Blank
Gather from memvar
EndScan
Thisform.Grid1.Refresh
This is the way I do it in my applications.
Enmanuel
>I've been looking though the archives and I can't find where some one may have had this same problem, so all ideas are welcome.
>
>I have a form that contains 2 grids. The first grid.recordsource is a cursor populated from a sql-select. In the doubleclick event of the textbox of this grid the selected record is added to the recordsource cursor of a second grid.
>
>Works wonderfully, but this is made so the user can change their mind. If a record is removed from the second grid, and then another record is added from the first grid, there is a blank row corresponding at the place held by the deleted record.
>
>There are blank spaces for all the records that are deleted. The record order seems to be whacked as well. Click on a record to delete it and the record above it deletes instead. If you try to delete all the records that were added after deleting one record, the last record is visible but cannot be deleted. The deletion is being fired by the doubleclick of the textbox in the second grid.
>
>TIA
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain