|
-
Feb 13th, 2012, 06:17 PM
#1
Thread Starter
New Member
Run Time error '3134' Syntax error in INSERT INTO statement
I can't for the life of me figure this out. The syntax looks good to me. Any help would be appreciated.
thanks
CurrentDb.Execute "Insert Into RulesNotCrD(AccountName, Note) Values ('" & Me.cboAcName & "','" & Me.Text18 & "')"
-
Feb 13th, 2012, 11:56 PM
#2
Re: Run Time error '3134' Syntax error in INSERT INTO statement
Have you checked what that actual string looks like? Never assume that the data you are using is what you think it is when it doesn't work. Always check.
Code:
MsgBox "Insert Into RulesNotCrD(AccountName, Note) Values ('" & Me.cboAcName & "','" & Me.Text18 & "')"
-
Feb 14th, 2012, 10:01 AM
#3
Thread Starter
New Member
Re: Run Time error '3134' Syntax error in INSERT INTO statement
It is the use of the column name 'Note'. It's a reserved word. So it either needs to be placed in brackets or another name needs to be used.
thanks!
Here's a link to a list of reserved words:
http://support.microsoft.com/default...b;en-us;286335
-
Feb 15th, 2012, 08:38 AM
#4
Re: Run Time error '3134' Syntax error in INSERT INTO statement
 Originally Posted by daveinchicago
That must depend on the database because in SQL Server 2005 this works just fine:
create table RulesNotCrD(AccountName char(10), Note char(20))
Insert Into RulesNotCrD(AccountName, Note) Values ('TestIt', 'TestNote')
select * from RulesNotCrD
drop table RulesNotCrD
-
Feb 15th, 2012, 08:50 AM
#5
Re: Run Time error '3134' Syntax error in INSERT INTO statement
It does depend on the database system, and various other things too (such as the driver/provider you are using to connect), which is why multiple lists are given for various items in the article What names should I NOT use for tables/fields/views/stored procedures/...? from our Database Development FAQs/Tutorials (at the top of this forum)
-
Jun 24th, 2015, 03:06 PM
#6
New Member
Re: Run Time error '3134' Syntax error in INSERT INTO statement
I have the same Issue I cant figure this out, whats wrong with this??
CurrentDb.Execute "INSERT INTO BillTabe(ID, Venor, TxnDate, RefNumber, LineItem, LineDesc, LineQty, LineBillableEntity, LineUnitPrice, LineAmount, LineBillableStatus)" & _
" VALUE(" & Me.txtID & "','" & Me.cboVendor & "','" & Me.txtTxnDate & "','" & Me.txtRefNumber & "','" & Me.txtLineItem & "','" & Me.txtLineDesc & "','" & Me.txtLineQty & "','" & _
Me.cboLineBillableEntity & "','" & Me.txtLineUnitPrice & "','" & Me.txtLineAmount & "','" & Me.txtLineBillableStatus & "')"
-
Jun 24th, 2015, 07:00 PM
#7
Re: Run Time error '3134' Syntax error in INSERT INTO statement
 Originally Posted by dpacheco30
I have the same Issue I cant figure this out, whats wrong with this??
CurrentDb.Execute "INSERT INTO BillTabe(ID, Venor, TxnDate, RefNumber, LineItem, LineDesc, LineQty, LineBillableEntity, LineUnitPrice, LineAmount, LineBillableStatus)" & _
" VALUE(" & Me.txtID & "','" & Me.cboVendor & "','" & Me.txtTxnDate & "','" & Me.txtRefNumber & "','" & Me.txtLineItem & "','" & Me.txtLineDesc & "','" & Me.txtLineQty & "','" & _
Me.cboLineBillableEntity & "','" & Me.txtLineUnitPrice & "','" & Me.txtLineAmount & "','" & Me.txtLineBillableStatus & "')"
Did you bother to read post #2 and do what it says? It would appear not. If you have the same problem then maybe follow the same advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|