posting a new record - no delete query specified [SOLVED] lazarus / 16-Databases ---------------------------------------------------------------------- timcs · 2014-03-30 08:45 I am using the master detail method with a SQLquery1 SQLtransaction1 IBConnection1 Datasource1 being the master link going to a SQLquery2 and Datasource2.  As these two tables are linked by a specific field, when creating a new record on the detail table, I need to add to the linked field the unique value. When I did this on Delphi I just got the value of the field from the master table in either the beforeInsert or beforepost.  However if I try and do this in Lazarus I get : SQLquery2 no delete query specified etc......  However I am not deleting the record I am posting it when this error comes up. On searching here and on the net, the general advice is to either set the select statement to a select * from or change the update method on the SQLQuery from upWhereKeyOnly to either upWhereALL/upWhereChanged.  I have tried all of these suggestions with no luck.  Considering that if I remark out this line of code :   Code: [Select]newpassnum := SQLquery1.FieldByName('passwordnum').AsInteger;    within either BeforePost or BeforeInsert, the error goes away now in the AfterPost method I have this : Code: [Select]SQlquery2.ApplyUpdates;   SQlTransaction1.CommitRetaining;  but as I have not yet written the newpassnum variable into any field in SQLquery2 I cannot understand this error Thanks TimCS ---------------------------------------------------------------------- timcs · 2014-03-30 18:34 Problem solved - when I changed the SQL in the properties of the SQLquery object it was not saving it as I had the dataset active  Now that it lists all fields this is working and I had to also get the stored procedure to work as well which I have also done after reading up on this from posts here. Thanks TimCS