Thisform.DeleteRecord( nRecNo ) NODEFAULTand put this code into the form's deleteRecord method:
LPARAMETERS tnRecNo LOCAL lcAlias, loColumn lcAlias = Thisform.Grid1.recordSOurce GO tnrecord IN ( lcAlias ) IF DELETED( lcAlias ) RECALL IN ( lcAlias ) *** Move record pointer to refresh grid SKIP IN ( lcAlias ) SKIP -1 IN ( lcAlias ) ELSE DELETE IN ( lcAlias ) *** Must do a TableUpdate as soon as the record is deleted. Otherwise, *** when it is recalled, you will get a PK violation IF ! TABLEUPDATE ( 0, .F., lcAlias ) MESSAGEBOX( 'Unable to Update Table', 48, 'So Sorry!' ) ENDIF *** Need to move record pointer to refresh display SKIP IN ( lcAlias ) IF EOF( .RecordSource ) GO BOTTOM IN ( .RecordSource ) ENDIF ENDIF*** Now call your code to change all the item numbers here
*** Refresh the grid by setting focus to it *** Find out which column is the first column FOR EACH loColumn IN Thisform.Grid1.Columns IF loColumn.ColumnOrder = 1 loColumn.SetFocus() EXIT ENDIF ENDFORChange This: