parsing name field into first and last discarding middle initial 
Author Message
 parsing name field into first and last discarding middle initial

Help anyone?

I need proceedure or query that parses a name field into first and last,
checking for a single charecter intitial in middle and discarding it.

thanx bunches
james



Sun, 16 Jan 2005 06:46:01 GMT  
 parsing name field into first and last discarding middle initial
Look at InStr / Left / Right / Mid / and Len functions in
the VBA/Access help files.  It will take some doing, but
with those tools you should be able to figure it out.

HTH
Tim Hansen

========================

Quote:
>-----Original Message-----
>Help anyone?

>I need proceedure or query that parses a name field into
first and last,
>checking for a single charecter intitial in middle and
discarding it.

>thanx bunches
>james

>.



Sun, 16 Jan 2005 08:24:30 GMT  
 parsing name field into first and last discarding middle initial
What version of Access?

You can use Instr to find the first space and that should work to get you the
first name.

But, I see problems with names such as
Mary Anne Van Hooten
Robert R. Jones
Robert R Jones (No Period)
James Earl Jones

If your names are consistently entered (good luck there) then you can write a
VBA routine to parse this into parts.  In Access 2K and later you can take
advantage of the Split function to break the name field into parts based on a
space.  Look up Split function in the Visual Basic Help.

  Dim asNameParts(0) as string
  asNameParts = Split([FullName]," ")

Then use the array functions to get the size of the array (Lbound, Ubound), and
examine the various parts to determine First Name; middle initial (if any), Last
Name

Quote:

> Help anyone?

> I need proceedure or query that parses a name field into first and last,
> checking for a single charecter intitial in middle and discarding it.

> thanx bunches
> james



Sun, 16 Jan 2005 19:58:36 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How do I parse name into first and last name fields

2. Seperating First, Middle, Last Name from one field

3. First Last Middle Elements in Arrays...

4. Split Full Name to First/Last Name

5. last, first name need them switch

6. Retrieve a person's first and last Name in GAL using CDO

7. Splitting First and last name

8. Seperating first and last name

9. Need Help on Importing Field Names from First Record for Fixed Field data

10. middle initial

11. parsing name fields debug code

 

 
Powered by phpBB® Forum Software