I am trying to run this statement but receive a syntax error.
The intention is to run this query collecting all records for GuestID 195 and appending the table with these same records but assigned to GuestID 196. That is the intention.
I have done a debug to the intermediate window and pasted into a query which gives me this;
INSERT INTO tblGuestProduct (GuestID, ProductID, RetailPrice) SELECT 195, ProductID, RetailPrice, FROM tblGuestProduct WHERE GuestID = 196
but this gives me a syntax error with the "FROM' highlighted.
Note that I am am trying to copy the GuestID record 195 into a new guest record of 196 but with the same fields of 195 (same table).
Can anyone help with the syntax error please?
The intention is to run this query collecting all records for GuestID 195 and appending the table with these same records but assigned to GuestID 196. That is the intention.
Code:
strSQL = "INSERT INTO tblGuestProduct (GuestID, ProductID, RetailPrice)" _
& " SELECT " & newGuestID & "," _
& " ProductID," _
& " RetailPrice," _
& " FROM tblGuestProduct" _
& " WHERE GuestID = " & oldGuestID
I have done a debug to the intermediate window and pasted into a query which gives me this;
INSERT INTO tblGuestProduct (GuestID, ProductID, RetailPrice) SELECT 195, ProductID, RetailPrice, FROM tblGuestProduct WHERE GuestID = 196
but this gives me a syntax error with the "FROM' highlighted.
Note that I am am trying to copy the GuestID record 195 into a new guest record of 196 but with the same fields of 195 (same table).
Can anyone help with the syntax error please?