Results 1 to 9 of 9
  1. #1
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195

    Remove Any Duplicate Words From Text Field

    Hi Guy's what is the method of finding and removing any duplicate words from a text field ?

    Would something like:



    Set rs = Currentdb("Select * From Table")

    If Instr(rs.Fields")

    then

    replace("rs.Fields")

    be a method ?

    I can't think of the correct method but would imagine i would need to use Instr and Replace functions ?

    Kindest

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,941
    No idea, but I know where I would start.

    https://www.google.com/search?q=remo...hrome&ie=UTF-8
    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

  3. #3
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    WGM durrr silly me, I did search google but slightly different to how you searched

    yes create a find duplicate query, copy the SQL and Run SQL

    will give that a shot (no silly errors from me this time), i have copied the table in case I remove data i dont want to remove

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,941
    Well there was a function in one of those links.
    The duplicate query is for records, not duplicate words in a field, so I would look again?
    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

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Here is a module with a few very useful string manipulation functions that I've been using for years.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  6. #6
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    Thanks Vlad, will have a look

  7. #7
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    WGM, yes i realized that when i tried the wizard!!

    Hi Vlad, that modFunction is a BAS file, is that correct as my PC is trying to find a program to open it ?

  8. #8
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Yes, that is the default when you export a module from Access VBA interface. Just open it with Notepad (you could even change the extension to .txt) and copy and paste it in a new module or import it from within your Access project.

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  9. #9
    DMT Dave is offline VIP
    Windows 10 Access 2016
    Join Date
    May 2018
    Posts
    1,195
    OK Vlad, thank you, i have never come across a BAS File before, now understand

    Will take a look

    Kindest

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

Similar Threads

  1. remove extra white space from duplicate field
    By ensorde in forum Reports
    Replies: 2
    Last Post: 10-01-2014, 08:31 AM
  2. Replies: 9
    Last Post: 10-01-2013, 08:48 AM
  3. Remove some certain words, tags in fields
    By shinichi_nguyen in forum Access
    Replies: 1
    Last Post: 08-09-2013, 01:44 PM
  4. Replies: 3
    Last Post: 05-29-2012, 04:47 PM
  5. Textbox, remove certain words.
    By dgrzalja in forum Forms
    Replies: 0
    Last Post: 11-03-2009, 09:42 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