By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,762 Members | 1,836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,762 IT Pros & Developers. It's quick & easy.

Sql - insert into

P: 13
I have an sql statement which I was hoping someone may be able to help me with. I'm getting the following errors:
1 - runtime error 3346 (Number of query values and destination values are not the same
2 - Runtime Error 3075 syntax

Expand|Select|Wrap|Line Numbers
  1. strSql = "INSERT INTO tblConversation ( " & _
  2.                 "RecordID, LeadID, Conversation, Subject, DateEntered, ContactDate, ContactTime, FollowUpDate )" & _
  3.                 "Values (" & _
  4.                 "'" & Me!LeadID & "', " & _
  5.                 "'" & Me!RecordID & "', " & _
  6.                 "'" & Me!Conversation & "', " & _
  7.                 "'" & Me!Subject & "', " & _
  8.                 "'" & "#" & Date & "#" & "', " & _
  9.                 "'" & "#" & Me!ContactDate & "#" & "', " & _
  10.                 "'" & "#" & Me!ContactTime & "#" & "', " & _
  11.                 "'" & "#" & Me!FollowUpDate & "#" & "', " & _
  12.                 "FROM frmTenantConvoEntry where Recordid = " & Me!RecordID
  13.  
  14. DoCmd.RunSQL (strSql)
  15.  
  16.  
Please note - I am trying to pull values from a form and enter them into a table...
May 29 '12 #1
Share this Question
Share on Google+
4 Replies


nico5038
Expert 2.5K+
P: 3,072
Best to start with printing the string in the immediate window and post it here.
I guess something with the comma"s isn't right
May 29 '12 #2

P: 14
have to look carefully as how the datatime fields is formatted. must keep in mind the regional settings from windows.you have to get this type of value"2012.05.30...." and i think you get "2012,05,30...."
May 29 '12 #3

P: 4
dont u think it should be 'recordId' n then 'lead ID' after 'values'....
u r specifying table name after 'into' n also after 'from'.. where as i know insert cant have form clause with it.just confirm it
May 29 '12 #4

Rabbit
Expert Mod 10K+
P: 12,366
You specified the VALUES and FROM keyword, one does not go with the other.
May 30 '12 #5

Post your reply

Sign in to post your reply or Sign up for a free account.