Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Remove duplicate words from a memo field
Norman M 

10 years ago
I have a table CONCATENATE

I have a record called Description (it is a text field).
I have 5 products that are the same model but with multiple slightly different descriptions.

Look at this as an example.
http://www.amazon.co.uk/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=C-exv9+
All C-EXV9.

I have concatenated all these description into one Field Tile (1000 + words)  

I want to remove duplicate words

So for example:

C-exv9 laser toner laser cartridge toner Cexv9 c-exv9

Becomes in field memo new title

C-exv9 laser toner cartridge Cexv9
(word order does not matter)

I found this code:

Public Function getNoDupString(strDupString As String)
  Dim strDupArray() As String
  Dim intCounterI As Integer
  Dim intCounterJ As Integer
  Dim intFirstPos As Integer
  strDupArray = Split(strDupString, ",")
  For intCounterI = 0 To UBound(strDupArray)
     For intCounterJ = intCounterI + 1 To UBound(strDupArray)
       If Trim(strDupArray(intCounterJ)) = Trim(strDupArray(intCounterI)) Then
         strDupArray(intCounterJ) = ""
       End If
     Next intCounterJ
  Next intCounterI
  For intCounterI = 0 To UBound(strDupArray)
    If Not strDupArray(intCounterI) = "" Then
      getNoDupString = getNoDupString & strDupArray(intCounterI) & ","
    End If
  Next intCounterI
  If Right(getNoDupString, 1) = "," Then
    getNoDupString = Left(getNoDupString, Len(getNoDupString) - 1)
  End If
End Function

I ran as:

Update Concatenate set newtitle = getNoDupString(title)

No errors but nothing happens. I ma guessing this is because they are memo fields?

Can you help please.


Reply from Alex Hedley:

Is there a Field in Concatenate called newtitle?

Have you tried running the code in the Immediate Window to test it, or on a Form first.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/15/2026 4:12:17 AM. PLT: 1s