Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid.Deleted Method question: 1

Status
Not open for further replies.

foxrainer

Programmer
Jan 10, 2002
270
US
Hi all,

can someone explain the sequence of events when one clicks on the 'deleted' column/ tab in a grid?
I know it triggers the grid.deleted method.

Here is what I have in mind:
User clicks on Deleted tab/ column in grid.
It calls the deleted. method
Code asking if sure to delete (Messagebox ...)
If yes
Return
Else
prevent form deletion && here comes the question
Endif

The question: in the 'prevent deletion' line, is the record already marked for deletion at this time and I need to issue a TableRevert, or, is it not yet deleted and I need to issue a Return .f.

Any help would be appreciated!

Rainer
 
That's kind of playing with fire. Especially if you have SET DELETED ON. The record gets deleted, a dialog pops up causing the grid to lose focus. You respond, and the grid regains focus. The record may disappear, and the record pointer moves to the next record. Too late to do a recall now.
I would suggest not using the deleted column and create your own 'Delete' button where you can verify the delete question, and either delete the record or not. (Within a transaction if needed.) Especially if there is any sort of referential integrity involved.


-Dave S.-
[cheers]
Even more Fox stuff at:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top