Hello All,
I am trying to select a row from a table and insert it into the same table with a different primary key. I've tried hard enough but get a syntax error :banghead:. Below is the code I've been using. Any sort of help will be appreciated.
NB: QuoteID is the Primary Key
I am trying to select a row from a table and insert it into the same table with a different primary key. I've tried hard enough but get a syntax error :banghead:. Below is the code I've been using. Any sort of help will be appreciated.
Code:
strSQL = "Insert into tbl_A (CustomerID, quoteTypeID, OccupationClassID, strOccupationTitle, curAnnualEarnings, dblDiscount, dtmEffDate, dtmCommencementDate, lstPaymentFrequency, strAppNumber, ProductTypeID, strDesiredOccupationTitle, DesiredOccupationClassID, DesiredTerminationAgeID ) values ( Select tblQuotes.CustomerID, tblQuotes.quoteTypeID, tblQuotes.OccupationClassID, tblQuotes.strOccupationTitle, tblQuotes.curAnnualEarnings, tblQuotes.dblDiscount, tblQuotes.dtmEffDate, tblQuotes.dtmCommencementDate, tblQuotes.lstPaymentFrequency, tblQuotes.strAppNumber, tblQuotes.ProductTypeID, tblQuotes.strDesiredOccupationTitle, tblQuotes.DesiredOccupationClassID, tblQuotes.DesiredTerminationAgeID from tblQuotes where tblQuotes.QuoteID = " & Me.sfrmQuotes!quoteID & ");"
CurrentDb.Execute strSQL
NB: QuoteID is the Primary Key