If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Visual Basic > Syntax Error in Insert Into

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-11, 13:55
18Dude88 18Dude88 is offline
Registered User
 
Join Date: Nov 2011
Posts: 9
Syntax Error in Insert Into

Hi,

I have the following insert into getting the results from a previously run query,

DoCmd****nSQL "INSERT INTO promise_date_changes([WO#], PRCMPY, [PRORD#], O1LINE, [O1PO#1], Promise, O1YNID, O1TYPE, O1YCLR, O1OQTY, O1AQTY, Ship)VALUES, " & _
"(rst2![WO#], rst2![PRCMPY], rst2![PRORD#], rst2![O1LINE], rst2![O1PO#1], rst2![Promise], rst2![O1YNID], rst2![O1TYPE], rst2![O1YCLR], rst2![O1OQTY] ,rst2![O1AQTY], rst2![ship])"


Not sure why this is not working, please advise
Reply With Quote
  #2 (permalink)  
Old 12-05-11, 13:55
18Dude88 18Dude88 is offline
Registered User
 
Join Date: Nov 2011
Posts: 9
The **** is not on my page dont know why it showed up
Reply With Quote
  #3 (permalink)  
Old 12-05-11, 14:04
18Dude88 18Dude88 is offline
Registered User
 
Join Date: Nov 2011
Posts: 9
The **** is not on my page dont know why it showed up
Reply With Quote
  #4 (permalink)  
Old 12-05-11, 20:55
rokslide rokslide is offline
Registered User
 
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
You don't want a comma after values do you?

Shouldn't it just be

[code]
"INSERT INTO promise_date_changes([WO#], PRCMPY, [PRORD#], O1LINE, [O1PO#1], Promise, O1YNID, O1TYPE, O1YCLR, O1OQTY, O1AQTY, Ship) VALUES " & _
"(rst2![WO#], rst2![PRCMPY], rst2![PRORD#], rst2![O1LINE], rst2![O1PO#1], rst2![Promise], rst2![O1YNID], rst2![O1TYPE], rst2![O1YCLR], rst2![O1OQTY] ,rst2![O1AQTY], rst2![ship])"
[code]
Reply With Quote
Reply

Tags
inser into error

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On