Access - First Name Field, Remove Middle Initial or Middle Name

I have tried using the following formula:

Trim(Left([Cleaned Name],InStr([Cleaned Name]," ")))

to get just the first name from a first name field that may or may not have a middle initial or middle name. However, the resulting output is the first name only if there was a middle name or middle initial. However, the first name field is blank if there was not middle name/initial.

Example

Crystal Janice returns Crystal
Crystal J returns Crystal

but

Crystal doe not return anything

Thank you.
exp vgAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mlmccCommented:
Try it this way

Split({Cleaned Name}," ")[1]

mlmcc
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
exp vgAuthor Commented:
I tried this, and got a syntax error.

I also tried changing the } to ]
0
exp vgAuthor Commented:
I try this

trim(split([First Name]," ")(0)

And I get an error statement that there is an invalid dot (.) or !

Thank you.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

exp vgAuthor Commented:
Or the error also has an invalid parantheses. I am trying to modify and it is not working.
0
exp vgAuthor Commented:
I changed to this

trim(split([First Name])," ")(0)

And am getting the statement that I have an invalid number of arguments.

Thank you.
0
exp vgAuthor Commented:
Thank you - this is getting me closer - but not quite there.
0
mlmccCommented:
Sorry, this showed up in my Crystal Reports folder.  I see you want it in MS Access

Try this

IF InStr([Cleaned Name]," ") > 0 then
    Trim(Left([Cleaned Name],InStr([Cleaned Name]," ")))
Else
     [Cleaned Name]

mlmcc
0
exp vgAuthor Commented:
Thanks so much:

I tried

IF InStr ([First Name]," ") > 0 then Trim(Left([First Name],InStr([First Name]," "))), Else[First Name]

but there is a formatting issue I am unable to catch
0
Dale FyeCommented:
Did you even try the function I provided the other day in this response to an almost identical post?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.