Results 1 to 2 of 2
  1. #1
    thep is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    1

    update query in access vba

    I have an update query but I cant get it to work for some reason.

    hope I can find some answer to this.

    CurrentDb.Execute "UPDATE TT_PumpInfo SET TT_PumpInfo.UPC = " & Me.txtUPC & " WHERE (((TT_PumpInfo.SerialNo)= " & Me.SerialNo & "));"



    this is my query and I keep getting error 3144 syntax error.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    When constructing SQL in VBA, text fields require apostrophe delimiters for data. Date fields require # delimiter

    CurrentDb.Execute "UPDATE TT_PumpInfo SET UPC = '" & Me.txtUPC & "' WHERE SerialNo = '" & Me.SerialNo & "';"
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. [access 2007] Update Query And Function
    By Zoroxeus in forum Queries
    Replies: 4
    Last Post: 04-16-2012, 04:19 PM
  2. Access update query not working
    By Paul-NYS in forum Queries
    Replies: 5
    Last Post: 03-03-2012, 02:16 PM
  3. Access Update Query returns -1
    By Chris Morag in forum Queries
    Replies: 2
    Last Post: 05-27-2011, 06:02 AM
  4. Access 2003: Can't update from query
    By WestofYouLB in forum Access
    Replies: 4
    Last Post: 04-23-2011, 05:07 PM
  5. Running update query in access 2010
    By dbansal in forum Queries
    Replies: 1
    Last Post: 09-03-2010, 10:57 AM

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