String manipulation

J

James P

I have a single string consisting of last name, a comma, a first name and a
middle initial. I want to populate individual last name, first name and
middle initial fields. The comma is obviously the first identifier and the
space between the first name and middle initial is another identifier. What
expression do I use to populate the various fields? I'm using Access 2003.
Thank you
 
O

Ofer

If the field is always build as you said then you can use this
split(MyName,",")(0) ' Return Last Name
split(trim(split(MyName,",")(1))," ")(0) ' Return First Name
split(trim(split(MyName,",")(1))," ")(1) 'Return middle initial
 
Top