I have a text field that contains names and numbers separated by a coma. Ex
(2031 Mary Jane Smith, Jim Anderson, Bill Wright) what I'd like to do is find
Mary and then look her up in the student master file (there will be only one
Mary Jane Smith in the file), when I've done that I want to move to the next
person in the list and find him in the student master. What's the best way
to search through this field and get each person out.
Thanks for all your help.
Tom
That is an almost impossible task, Tom. Name matching and Address matching
are never going to be 100% accurate. There are too many variables. You have
already encountered one. How do we know Mary Jane Smith is Mary Smith in a
table field? Sure, you can do some string manipulation to take the middle
name out and search by first and last, but then you have the problem of
people who have multiple middle names (George Herbert Walker Bush) and those
who have either first are last names that have a space in them (Rip van
Winkle, John Wilkes Booth Jr). And, we haven't even discussed data entry
errors.
But, as a strart, use the Split function to create an array of the names you
will try match and loop throught the resultant array using DLookup to try to
find them.
Best of luck.

Signature
Dave Hargis, Microsoft Access MVP
> I have a text field that contains names and numbers separated by a coma. Ex
> (2031 Mary Jane Smith, Jim Anderson, Bill Wright) what I'd like to do is find
[quoted text clipped - 5 lines]
> Thanks for all your help.
> Tom
CD Tom - 19 May 2008 21:07 GMT
Not to sure about the split function? Couldn't I search for the end of the
string and then work backward until I found the coma and that would be one
person, I know for a fact that each name is separated by a coma.
> That is an almost impossible task, Tom. Name matching and Address matching
> are never going to be 100% accurate. There are too many variables. You have
[quoted text clipped - 21 lines]
> > Thanks for all your help.
> > Tom
Klatuu - 19 May 2008 21:14 GMT
Split function is less work.
Dim varNameList As Variant
Dim lngX as Long
varNameList = Split(txtAllName, ",")
For lngX = 0 To Unbound(varNameList)
'Here is where you try to find the name
Next lngX

Signature
Dave Hargis, Microsoft Access MVP
> Not to sure about the split function? Couldn't I search for the end of the
> string and then work backward until I found the coma and that would be one
[quoted text clipped - 25 lines]
> > > Thanks for all your help.
> > > Tom
CD Tom - 19 May 2008 21:53 GMT
I'll give that a try and let you know. Thanks for all your help.
> Split function is less work.
>
[quoted text clipped - 35 lines]
> > > > Thanks for all your help.
> > > > Tom
CD Tom - 19 May 2008 22:12 GMT
In the statement For LngX t= 0 to Unbound(varNameList) what is the Unbound?
> Split function is less work.
>
[quoted text clipped - 35 lines]
> > > > Thanks for all your help.
> > > > Tom
Beetle - 19 May 2008 23:09 GMT
That should be UBound, not Unbound. UBound represents the largest
available value in the array

Signature
_________
Sean Bailey
> In the statement For LngX t= 0 to Unbound(varNameList) what is the Unbound?
>
[quoted text clipped - 37 lines]
> > > > > Thanks for all your help.
> > > > > Tom
Klatuu - 19 May 2008 23:11 GMT
Ubound misspelled :)

Signature
Dave Hargis, Microsoft Access MVP
> In the statement For LngX t= 0 to Unbound(varNameList) what is the Unbound?
>
[quoted text clipped - 37 lines]
> > > > > Thanks for all your help.
> > > > > Tom