You have an extra open paren: strSQL = "INSERT INTO tblOrderDetails " & _ "(OrderID, ItemID, ItemQuantity, ItemDiscount) " & _ "SELECT " & lngOrderID & " As OrderID, " & _ "ItemID, ItemQuantity, ItemDiscount " & _ "FROM tblOfferDetails " & _ "WHERE OfferID=" & Me.OfferID & ");"
John Viescas, author "Building Microsoft Access Applications" "Microsoft Office Access 2003 Inside Out" "Running Microsoft Access 2000" "SQL Queries for Mere Mortals" http://www.viescas.com/ > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of tyki9799 > Sent: Thursday, June 23, 2005 7:46 AM > To: [email protected] > Subject: [ms_access] Re: Moving records between tables > > > Hi John. I did so. The records from tblOffers move to tblOrders fine! > Thanks. I got some problem moving records from tblOfferDetails to > tblOrderDetails. > I get a "run-time error '3134': Syntax error in INSERT INTO > statement". > It point to: > > DoCmd.RunSQL strSQL > > The whole INSERT stataments is now like this: > > strSQL = "INSERT INTO tblOrderDetails " & _ > "(OrderID, ItemID, ItemQuantity, ItemDiscount) " & _ > "(SELECT " & lngOrderID & " As OrderID, " & _ > "ItemID, ItemQuantity, ItemDiscount " & _ > "FROM tblOfferDetails " & _ > "WHERE OfferID=" & Me.OfferID & ");" > > DoCmd.RunSQL strSQL > > Regards, > > Theodore > > > > > > > Yahoo! Groups Links > > > > > Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/ms_access/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
