Results 1 to 6 of 6
  1. #1
    JET is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    3

    Delete Specific Text Strings in a Field

    I have a text field that I want to remove specific text strings from.
    For example:
    Work Order ListtasksCAT5, Connect CCC Internet, Connect Cable, Connect PH Fiber, DRIVE TIME, Deliver STB (3), MK+MISC ADVERTISING,

    I want to specifically remove all instances of the words CAT5, CONNECT, DRIVE TIME, DELIVER from all records in the table to shorten its length.

    This is a self taught project that i've been able to stumble my way through quite well, but for the life of me i can't seem to find out how to accoplish this.



    Thanks in advance for any possible help in the matter.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    You can use an update query with the Replace() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    JET is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    3
    Thanks for such a speedy reply.

    That was the path i was taking. I've succesfully got it to work with one string of text, but can't figure out how perform this for the other 4 or so strings i want to remove.

    Do I just input the same code with different criteria in separate columns for each string?

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If it's a one-time thing you can just run the query once for each string. You can also nest Replace() functions, along the lines of:

    Replace(Replace(FieldName, "abc", ""), "def", "")
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    JET is offline Novice
    Windows XP Access 2003
    Join Date
    Aug 2011
    Posts
    3
    It will have to be performed repeatedly as new data is imported.
    Looks like the nested replace will fit the bill.
    Thank you very much for the help.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Happy to help, and welcome to the site!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Query Out Specific Text
    By ysabella in forum Queries
    Replies: 1
    Last Post: 11-19-2015, 03:53 AM
  2. Replies: 11
    Last Post: 06-02-2011, 10:21 AM
  3. Replies: 15
    Last Post: 10-14-2010, 12:22 PM
  4. Replies: 2
    Last Post: 05-05-2010, 02:52 PM
  5. Text Box to show specific record
    By chu3w in forum Forms
    Replies: 1
    Last Post: 04-01-2010, 12:23 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