Smart questions
Smart answers
Smart people
Join Tek-Tips Forums
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login




Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

Join Tek-Tips
*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.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Runtime Error 3134 Syntax Error in INSERT INTO statementHelpful Member!(2) 

daveinchicago (IS/IT--Management) (OP)
13 Feb 12 17:46
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 & "')"
PHV (MIS)
13 Feb 12 18:22
What about this ?

CODE

CurrentDb.Execute "INSERT INTO RulesNotCrD(AccountName,Note) VALUES ('" & Replace(Me.cboAcName, "'", "''") & "','" & Replace(Me.Text18, "'", "''") & "')"

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

daveinchicago (IS/IT--Management) (OP)
13 Feb 12 18:36
Thank you!!

Just tried.  Same exact error...

wierd...
 
daveinchicago (IS/IT--Management) (OP)
13 Feb 12 18:38
However, this works...

CurrentDb.Execute "Insert Into RulesNotCrD(AccountName) Values ('" & Me.cboAcName.Value & "')"
daveinchicago (IS/IT--Management) (OP)
13 Feb 12 18:41
It was the use of the column name 'Note'.  I changed the column name to 'RuleNote' and it works great!

thank you!!
Helpful Member!  TheAceMan1 (Programmer)
13 Feb 12 19:51
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

Helpful Member!  MazeWorX (IS/IT--Management)
14 Feb 12 3:16
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>>

dhookom (Programmer)
14 Feb 12 9:33
Allen Browne has another great source of Problem names and reserved words in Access.

Duane
Hook'D on Access
MS Access MVP

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!

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