Cancelling deletes using BeforeDelete

Cancelling deletes using BeforeDelete

Postby chuckbeasley » Wed 21 Dec 2005 17:31

I'm attempting to cancel a delete using Application.MessageBox displayed during the TMyTable.BeforeDelete event. If the user decides not to delete the record (IDNO), I'm issuing the TMyTable.Cancel event. However, the record is still being deleted. Why? Is there any other way to abort the delete?

Thanks
chuckbeasley
 

Postby GEswin » Wed 21 Dec 2005 17:55

Simply call

Code: Select all
Abort;


and the delete will be cancelled.
GEswin
 
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain

Postby chuckbeasley » Wed 21 Dec 2005 17:57

Thanks! That fixed it.
chuckbeasley
 


Return to MySQL Data Access Components