grid that link a form using sc_link(...)

Hi All,
I’ve have a little problem connecting grid to form.
I need to use form in grid to edit a field.
I have to use sc_link(…) because need dynamic link depending by variable.
On the form OnAfterUpdate event I put sc_redir(…) to return to grid after pressing “Save” button.
Problem is when control go back to grid from form , grid lose current row and start again from row #1
Using link created using graphical interface it works fine
I put sc_link(…) in OnRecord event of the grid and I put sc_redir(…) on OnAfterUpdate event of the form to return pressing “Save” button.
Thank You in advance for Your help