On our main data entry screen, we have an OK/Cancel dialog in the OnBeforePost event.
Calling the method Abort
(from the unit System
, if I recall correctly) raises a silent EAbort
exception, which cancels just the current operation. That should work.
(Btw: this method of cancelling a databaset operation is also described somewhere deep in the help system as the 'normal' way to achieve this --- that's where I got this technique from originally).