Results 1 to 3 of 3
  1. #1
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479

    Run-time error '3137':

    I'm getting error
    Missing semicolon ( at end of SQL statement.
    But there is, so it must be something else ?


    Code:
    sql = "UPDATE flacTracks SET flacTracks." & Combo0 & " = " & Chr$(34) & Contents & Chr$(34) & " Where (ttrack between " & Dat(0) & " and " & Dat(1) & ") and TCat = " & ThisDisk() & " Order by ttrack ;"
    CurrentDb.Execute (sql)
    UPDATE flacTracks SET flacTracks.Path = "Greatest Hits & Favorites CD 1" Where (ttrack between 124 and 143) and TCat = 1017 Order by ttrack ;

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    An action SQL should run just fine without semi-colon.

    There is no need for ORDER BY clause in any action SQL, really serves no purpose. In fact, I just confirmed that is cause of error.

    Should not need to prefix Path with table name but doesn't hurt.

    Are ttrack and tCat actually number type fields?
    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.

  3. #3
    Middlemarch is offline Competent Performer
    Windows 10 Access 2019
    Join Date
    Mar 2015
    Posts
    479
    Thanks June, it worked perfectly with those changes
    Yes, those two are number fields.

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

Similar Threads

  1. Replies: 3
    Last Post: 04-06-2021, 06:25 AM
  2. Replies: 13
    Last Post: 05-31-2019, 10:48 PM
  3. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  4. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  5. Replies: 6
    Last Post: 05-30-2012, 12:32 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