Results 1 to 4 of 4
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919

    Stubern syntax error

    CurrentDb.Execute "UPDATE RoomID IN APPENDAGES WHERE (RecID = " & SelectID & " AND RetYear = " & """" & gblRetreatYear & """" & ");"




    I"m going blind trying to find the syntax error in the above UPDATE. "RoomID" and "SelectID" are both integer and "gblRetreatYear" is string, as are the corresponding table fields in the table "APPENDAGES". I even assigned the expression to a temp string and viewed the results. Everything looks okay but still the error.

    Been a long day, so thanks for any help.
    Bill

  2. #2
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Better make that stubborn..........told you it had been a long day.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Update with what? There is no SET clause in the SQL statement. RetYear is a text field? The correct syntax is:

    "UPDATE APPENDAGES SET RoomID=something WHERE RecID = " & SelectID & " AND RetYear = '" & gblRetreatYear & "';"
    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.

  4. #4
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 7 64bit Access 2003
    Join Date
    Feb 2011
    Posts
    1,919
    Good grief, yesterday was just "one of those days"!

    CurrentDb.Execute "UPDATE APPENDAGES SET RoomID = " & Me.RmsID & " WHERE RecID = " & SelectID & " AND RetYear = '" & gblRetreatYear & "';"

    Thanks,
    Bill

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

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  2. Compile Error: Syntax Error in DoCmd.RunSQL Statement
    By Evilferret in forum Programming
    Replies: 1
    Last Post: 08-27-2012, 12:32 PM
  3. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  4. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  5. Incomplete Syntax Clause (syntax error)
    By ajetrumpet in forum Programming
    Replies: 4
    Last Post: 09-11-2010, 10:47 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