Results 1 to 4 of 4
  1. #1
    SmallBusiness is offline Novice
    Windows 10 Access 2007
    Join Date
    Dec 2023
    Posts
    1

    Syntax Error in changing a field’s contents

    We have been trying to correct the code in this Access 2003 form without success and continue to have a syntax error.



    Any assistance will be appreciated.

    Thank you
    Marylyn
    Attached Files Attached Files

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Couple of problems:

    Code:
    CurrentDb.Execute "update Investments01_tbl" & _
      "set investigate = 'No' " & _
      "where Investmentl_ID in (SELECT Investmentl_ID from (" & Replace$(Me.RecordSource, ";", "") & "));"
    Your concatenation needs a space "update Investments01_tbl " & _

    The other problem is the form in which the code resides has no recordsource.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Cross-posted: https://www.access-programmers.co.uk/forums/threads/syntax-error-in-changing-a-fields-contents.329772/
    Please read: https://excelguru.ca/a-message-to-forum-cross-posters/
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,938
    Quote Originally Posted by Bob Fitz View Post
    Cross-posted: https://www.access-programmers.co.uk/forums/threads/syntax-error-in-changing-a-fields-contents.329772/
    Please read: https://excelguru.ca/a-message-to-forum-cross-posters/
    Bob,
    If I recall, this is a username that is used by everyone in the company, so you are talking to different people all the time?
    The username over at AWF is Access2010. Here is states they are using Windows 10 and 2007, and in the post they say 2003?

    In fact one of the questions over in AWF is to be able to upgrade from 2003 to 2007?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

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

Similar Threads

  1. Replies: 5
    Last Post: 07-15-2019, 10:20 AM
  2. Replies: 5
    Last Post: 09-16-2018, 01:18 PM
  3. Replies: 0
    Last Post: 03-29-2011, 04:11 PM
  4. VBA to update field contents...Error 91
    By jpkeller55 in forum Access
    Replies: 9
    Last Post: 10-11-2010, 07:52 PM
  5. Replies: 5
    Last Post: 09-17-2010, 09:48 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