×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Runtime Error 3134 Syntax Error in INSERT INTO statement
2

Runtime Error 3134 Syntax Error in INSERT INTO statement

Runtime Error 3134 Syntax Error in INSERT INTO statement

(OP)
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 & "')"

RE: Runtime Error 3134 Syntax Error in INSERT INTO statement

(OP)
Thank you!!

Just tried.  Same exact error...

wierd...
 

RE: Runtime Error 3134 Syntax Error in INSERT INTO statement

(OP)
However, this works...

CurrentDb.Execute "Insert Into RulesNotCrD(AccountName) Values ('" & Me.cboAcName.Value & "')"

RE: Runtime Error 3134 Syntax Error in INSERT INTO statement

(OP)
It was the use of the column name 'Note'.  I changed the column name to 'RuleNote' and it works great!

thank you!!

RE: Runtime Error 3134 Syntax Error in INSERT INTO statement

How are ya daveinchicago . . .

The SQL of your post origination is right on, only I'd put a space where shown ...

CODE

    RulesNotCrD (AccountName, Note)
 ... for easy reading. Otherwise at 1st glance RulesNotCrD(AccountName, Note) looks like a function ... although it should still work.

In any case I couldn't find anything wrong either. So I duplicated the table & fields and setup an append query in query design view to simulate the sql. To my surprise when I went to SQL View, I found that brackets [] embraced the Note field:

CODE

INSERT INTO RulesNotCrD ( AccountName, [Note] )
Removing the brackets I received the same error you quoted earlier.

So I tried the same in your VBA SQL and ... Voila! ... works as expected:

CODE

   SQL = "Insert Into RulesNotCrD (AccountName, [Note]) " & _
         "Values ('" & Me.cboAcName & "','" & Me.Text18 & "');"
Why this happens I can't say yet. One guess is that maybe Note has been promoted to a reserved word in 2003 or greater.

In any event add the brackets [] an see if it makes the difference.

Your Thoughts? . . .

See Ya! .  .  .  .  .  .

Be sure to see FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?  Worthy Reading! thumbsup2
Also FAQ181-2886: How can I maximize my chances of getting an answer?  Worthy Reading! thumbsup2

RE: Runtime Error 3134 Syntax Error in INSERT INTO statement

Ace you are correct 'Note' is a reserved word in 2002-2003. For those interested here is a list of reserved words from MS http://support.microsoft.com/default.aspx?scid=kb;en-us;286335

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close