Results 1 to 4 of 4
  1. #1
    SeanA is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29

    INSERT INTO Run-time error 3075 Syntax error (missing operator) in query expression

    Hello all!

    I'm having a little trouble with an INSERT INTO and error 3075. My code is as follows (note: "txtQuantityShipped" is the only number):



    Code:
    Private Sub cmdRecordShipment_Click()
        
        CurrentDb.Execute "INSERT INTO tblShipments(Part, Description, OldLocation, NewLocation, QuantityShipped, WhoReceivedParts, WhoAuthorizedShipment, ShipmentDate) VALUES (cmbPart," & Me.txtDescription & "," & Me.txtOldLocation & ", cmbBuilding, " & Me.txtWRP & ", " & Me.txtWAS & ", '" & Me.txtQuantityShipped & "', " & Me.txtDate & ")"
        
    End Sub
    I'm then getting the 3075 error on my description value:
    Syntax error (missing operator) in query expression 'SWIVEL ASSY'
    . However, the actual value in "txtDescription" is "SWIVEL ASSY, REMOTE CONTROL UNIT".

    Is this an error in my code or is it an error with my value?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Text data types require delimiters around the value. At its simplest an apostrophe. More here:

    http://www.baldyweb.com/BuildSQL.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    SeanA is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    29
    Yep, that solved it. Silly error by me. Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 01-22-2013, 04:23 PM
  2. Replies: 4
    Last Post: 07-25-2012, 04:01 AM
  3. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  4. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  5. Syntax error missing operator(3075)
    By parisienne in forum Programming
    Replies: 1
    Last Post: 04-07-2011, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums