Hi,
Before I insert a new record I want to verify if the record already exists. My approach is that I catch the BeforePost event, query the table and if record already exists just CANCEL the insert using TMyTable.Cancel.
However, after calling cancel the insert is not stopped but executed. Is it possible to abort the post? Or cannot I use the events for this purpose and should I validate the database before a Post is executed?
(The nice thing of using the BeforePost Event is, that I validate on one location.)
best regards,
hans
How to cancel an insert using TMyTable
Just call
Code: Select all
Abort;