Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Delete records in a table that a Grid is linked to
Message
 
To
04/12/1998 20:25:44
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00163988
Message ID:
00164510
Views:
22
The grid is not going to be blank if you SET DELETED OFF.
In Form's Init method you can put the following:

thisform.old_deleted = SET("DELETED")
SET DELETED OFF


In Form's Destroy method you can put the following code:

SELECT (thisfrom.grid.recordsource)
LOCATE FOR DELETED()
IF FOUND()
USE (thisfrom.grid.recordsource) AGAIN EXCLUSIVE && If the table is not
used exclusive
IF SELECT((thisfrom.grid.recordsource)) # 0
PACK
ENDIF
ENDIF
SET DELETED (thisform.old_deleted)
Of course you may handle the error (I can't remenber now what number).

In this way you can deleted some range of records and recall them if you just make a mistake.

:)
Boris
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform