Results 1 to 4 of 4
  1. #1
    kent is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    34

    Using Expression Builder to Replace text in Column

    I'm trying to remove a particular string that exists throughout the text in cells from a single column....
    Table Name: MAIN_Articles
    Column Name: Content
    String to remove: "color=black"

    I tried adding a command button to a blank form, and with expression builder created the phrase: =Replace([MAIN_Articles]![Content],"color=black"," ")

    However, when I click on it I get the error "The expression On Click you entered as the event property setting produced the following error: The object doesn't contain the Automation object 'MAIN_Articles'



    I'm not sure where to go from here. Anyone have any thoughts? Thanks!

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    IF I've understood your requirement correctly, you could just run an Update query. Something like:
    Code:
    UPDATE MAIN_Articles SET MAIN_Articles.Content = ""
    WHERE (((MAIN_Articles.Content)="color=black"));
    MAKE A BACKUP FIRST in case this isn't what you need.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    kent is offline Advanced Beginner
    Windows 10 Access 2016
    Join Date
    May 2019
    Posts
    34
    Thanks, I'm going to try this.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,540
    Quote Originally Posted by kent View Post
    Thanks, I'm going to try this.
    Good luck. Let us know how you get on. Don't forget that backup.

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

Similar Threads

  1. Replies: 12
    Last Post: 07-06-2017, 11:43 AM
  2. Replies: 3
    Last Post: 12-03-2015, 02:41 PM
  3. Replies: 1
    Last Post: 07-12-2013, 09:17 AM
  4. Replies: 2
    Last Post: 07-21-2012, 01:21 AM
  5. Text Box Expression Builder with Queries
    By blacksaibot in forum Access
    Replies: 7
    Last Post: 01-10-2012, 10:07 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