Page 1 of 1

Is it possible : fill the SQLUpdate property with 2 Statements

Posted: Thu 18 Aug 2005 08:06
by swierzbicki
Hi,

I have a master (with an autoinc field) query.
A detail query is linked to the master query.

After inserting and posting a master record, I want to automatically insert a record into the detail table.

I first choose the OnBeforePost event of the master table. But this isn't a good solution : it is triggered after dsedit / dsinsert state.

Then,on the master query, I launch the mysqlEditor and I've generated the SQL statements. In the SQL Insert statement, I've added a second statement that will fill the detail table given the master query autoinc field.

Insert went fine, but the second statement wans't executed.
Is there any workarround ?

Thank you

Posted: Mon 22 Aug 2005 11:46
by Ikar
Try to use AfterPost event

Posted: Mon 22 Aug 2005 12:36
by swierzbicki
Ok, AfterPost seems the easiest solution, but how to know if the "afterpost event" cames is fired by an insert/append or an edit event ?

Posted: Mon 22 Aug 2005 13:29
by Ikar
Try to set any flag on BeforeInsert and discard it on BeforeEdit.