Results 1 to 2 of 2
  1. #1
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451

    update SQL getting error

    sorry, i know this is going to be something simple but I've been looking at it for a while and don't see anything wrong. I'm working on an update SQL and am getting an error 3144 syntax error in update statement. anyone see anything wrong that i'm missing? the debug is coming back looking good with


    UPDATE 2lognamet SET RequestName='aaa', SET LocID='1', SET Lev='2'WHERE DsID='a222'

    Code:
            If (DCount("DsID", "2lognamet", "dsid='" & Me.txtdsid & "'") > 0) Then
                Dim sqlupdate As String
                sqlupdate = ("UPDATE 2lognamet " & _
                    "SET RequestName='" & Me.txtname & "'" & _
                    ", SET LocID='" & Me.cbolocation & "'" & _
                    ", SET Lev='" & Me.cbolev & "'" & _
                    "WHERE DsID='" & Me.txtdsid & "'")
                Debug.Print (sqlupdate)
                CurrentDb.Execute (sqlupdate)

  2. #2
    vicsaccess's Avatar
    vicsaccess is offline Competent Performer
    Windows 8 Access 2013
    Join Date
    Apr 2015
    Posts
    451
    oh, that's funny. ever look at something so long you can't see what's in front of you. If at first you don't succeed use the query builder and look at the syntax. I didn't need all the "sets". whoops.
    Code:
            If (DCount("DsID", "2lognamet", "dsid='" & Me.txtdsid & "'") > 0) Then
                Dim sqlupdate As String
                sqlupdate = ("UPDATE 2lognamet " & _
                    "SET RequestName='" & Me.txtname & "'" & _
                    ", LocID='" & Me.cbolocation & "'" & _
                    ", Lev='" & Me.cbolev & "'" & _
                    " WHERE DsID='" & Me.txtdsid & "'")
                Debug.Print (sqlupdate)
                CurrentDb.Execute (sqlupdate)

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

Similar Threads

  1. Replies: 5
    Last Post: 06-12-2015, 02:15 PM
  2. Replies: 2
    Last Post: 03-19-2015, 01:33 PM
  3. Error handling of table update error?
    By panoss in forum Forms
    Replies: 5
    Last Post: 10-31-2014, 02:06 PM
  4. Replies: 1
    Last Post: 09-22-2014, 08:54 AM
  5. Error 3144: Syntax error in UPDATE statement??
    By Paintballlovr in forum Programming
    Replies: 7
    Last Post: 03-26-2014, 12:53 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