Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete a record in a grid
Message
From
26/09/2001 11:37:29
 
 
To
26/09/2001 11:25:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00560917
Message ID:
00561021
Views:
31
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.com
ICQ #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.
Previous
Reply
Map
View

Click here to load this message in the networking platform