Hi, in the AfterUpdate event on my subform, I do this :

strSQL1 = "(INSERT INTO tbl_b1_history ( Hist_ID, date) SELECT tbl_b1.ID_b1, tbl_b1.date FROM tbl_b1 WHERE tbl_b1.ID=" + CStr(lID_b1)

(I have abbreviated / removed lots of fields here that is not relevant, as the insert statement works fine, see below)

with this :

DoCmd.RunSQL strSQL1

All variables are declared properly and contain the correct values before the Insert statement is triggered - the variable lID_b1 has value 50280 (when running), and there are no union queries around...

But I still get the message "Syntax Error in union query" when running that particular code, stopping at strSQL1, highlighting it.

If I copy the Insert statement onto the SQL view of a new query, replacing lID_b1 with 50280, and then running it in the Designer, the record is appended correctly...

What can be wrong here? Probably misguiding/"wrong" error message, but what can really be the problem?