>I have a form that has txt.mail_name. At first mail_name is copied in from another source and it is something like 'JOHNSON FRANK L & DORIS M", or 'JOHNSON FRANK L & STIEN DORIS M' once it is edited it becomes something like 'Frank & Doris Johnson'. The editing is done by hand so it is never exact. I am trying to prevent duplicate mail_name in my table. Looking for ideas on how to prevent this.
>
>Thinking that I could find the last name and then show a browse window of other matching last names.
>
>Guess that if mail_name is still in upper case, I know that the last name is the first word. And if mail_name is in proper case I know that the last word is a last name and if there are two words before the ' & ' is probablu a last name.
>
>Does anyone have any ideas or tips on preventing duplcate names?
Check soundex() function. You may
select * from names where upper(last_name)=upper(lcLastName) and ;
soundex(first_name)=soundex(lcFirstName)
or something like that (maybe also soundex() of the last name as well). Depending on the number of hits, you may OK the entry, or show a list of entries in a little modal form, with a listbox with names found, and a few buttons like "use selected", "none of them", "cancel, re-enter". That's what I do in some apps during name entry.