I solved with this code
Abort;
into BeforeInsert procedure!
Hmm. And Ctrl-alt-del to close the form
Abort raises a silent exception and you never know exactly in what state you leave the program. Code is triggered here by an event (key or mouse events) and aborted with an exception. I checked the database code and I think in this case you are lucky. I haven't checked all possible cases though.