First you should change line 101 in the display routine from edit_delete_id = rc.Row -1
to edit_delete_id = GetCell(rc.Row, 0)
Second, it's normal that SelectedRow = -1 after deleting. It's set to this value in ClearAll which is called in Loaddatas and it's logical too because after deleting the selected row there is no selected row anymore.
What SelectedRow value did you expect ?
you use marget's DB class, it's a breeze. You put the variable (expyear) into the filed (var1), then update record. It's so easy compared to that other db nonsense.