Find 'similar names' in Access

Dear experts -
We are finding duplicate names in our database - but some are not exactly the same.
Do you have any code for checking if a string is SIMILAR to another?
Thanks -
terpsichoreAsked:
Who is Participating?
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
How would you define a "reasonable percentage" ...

You can easily check if a First and Last name match:

Dim rst As DAO.Recordset
Set rst = Currentdb.OpenRecordset("SELECT * FROM YourTable WHERE LastName='" & Me.txLastName & "' AND FirstName='" & Me.txFirstName & "'")

If Not (rst.EOF and rst.BOF) Then
  '/ found a match on the first and last, now compare other information
 
End If

So if you then need to examine another value - for example, the Phone - you could continue along with that.
0
 
Jack LeachProprietorCommented:
That's a tough one, but look into Fuzzy Matches using SoundEx.  Allen Browne has an article on it here:

http://allenbrowne.com/vba-Soundex.html

hth
0
 
terpsichoreAuthor Commented:
Thanks - I was thinking more along the lines of: "if either first or last name is the same AND a reasonable percentage of the OTHER name are the same"...
0
 
terpsichoreAuthor Commented:
Good enough for now - many thanks.
0
All Courses

From novice to tech pro — start learning today.