Results 1 to 6 of 6
  1. #1
    steve7800 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    41

    What do I put in the Update To field of the query grid?

    I have a table with a field named lnkPath. The lnkPath field provides links to files stored outside of the Access database.



    The lnkPath field contains data like this:
    C:\OPHardware\ShopB\InfoLinks\filename.extension

    The path name is the same for all records. The filename.extension is different for every record.

    I need to change the InfoLinks segment of the path name to LinksItem so it looks like this:
    C:\OPHardware\ShopB\LinksItem\filename.extension

    This only needs to be done one time, so it seems that a manually executed UPDATE query should work. But I am at a loss as to how to implement it.

    Is an UPDATE query the way to go? If so, what do I put in the Update To field of the query grid?

    Thanks.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Yes, update query. To be clear, you only want to change one word: InfoLinks to LinksItem - the rest stays the same?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 7 32bit Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    MAKE A BACKUP. Then try:

    Replace("C:\OPHardware\ShopB\InfoLinks\filename.extension", "InfoLinks","LinksItem")
    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
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Each file name would be different, yes? If so, you can't explicitly quote it unless you want to do that for every different filename. I think "filename.extension" is just an example of one file name.
    It would be more like
    Code:
    UPDATE tblPaths SET tblPaths.Paths = Replace([Paths],"InfoLinks","LinksItem");
    where the table name is tblPaths and the field is Paths.
    AND YES, do any such changes on copies of your tables.

  5. #5
    steve7800 is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    41
    Yes, every file name is different.

    Replace("C:\OPHardware\ShopB\InfoLinks\filename.extension", "InfoLinks","LinksItem") does change InfoLinks to LinksItem but also changes every file name and extension to "filename.extension".

    UPDATE tblPaths SET Replace([Paths],"InfoLinks","LinksItem") did the trick. It changed InfoLinks to LinksItem but left the filename.extension intact.

    Thanks both of you very much. Wonderful help!!

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    You're welcome; glad to have helped.

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

Similar Threads

  1. Replies: 1
    Last Post: 03-11-2018, 11:44 AM
  2. Replies: 1
    Last Post: 10-27-2016, 12:14 PM
  3. Replies: 8
    Last Post: 12-03-2013, 08:40 AM
  4. Replies: 2
    Last Post: 08-30-2012, 07:59 AM
  5. Grid lines vs Grid Dots
    By dharriet in forum Access
    Replies: 0
    Last Post: 10-14-2008, 09:17 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