Hi!
Try following:
***********************************************
local lLockedHere
lLockedHere = !thisform.LockScreen
thisform.LockScreen = .T.
SELECT Contract
DELETE
SKIP
thsiform.Refresh
IF EOF() AND !BOF()
SKIP -1
thsiform.Refresh
ENDIF
THIS.PARENT.gridContract.SETFOCUS
thisform.LockScreen = !lLockedHere
*************************************************
Of course, SET DELETED should be ON. "thisform.Refresh" could be too much, try grid refreshing first.
HTH.
>I tried to remove my relation, delete the record and put it back, but it doesn't seem to work. I only have this problem when i enter 4 records and then delete the last one (4th). I don't have any problems deleting the 3 fisrt records. Here's the code i used to delete in the grid from a command button
>
>Code:
>***********************************************
>LOCAL liOldSel, lcCodeContract, lcRelationEmployeu, lcRelationContract
>
>
>SELECT Employeu
>lcRelationEmployeu = SET("RELATION")
>SET RELATION TO
>
>SELECT Contract
>lcRelationContract = SET("RELATION")
>SET RELATION TO
>
>DELETE
>
>SELECT Employeu
>SET RELATION TO &lcRelationEmployeu
>
>SELECT Contract
>SET RELATION TO &lcRelationContract
>
>THIS.PARENT.gridContract.REFRESH()
>THIS.PARENT.gridContract.SETFOCUS
>*************************************************
>
>Thanks again
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.