First Letter of each word

P

PJ

I have the following in a text box field:

=IIf([Comp Entered By] Is Null,"",Left([Comp Entered By],1) & Mid([Comp
Entered By],InStr(1,[Comp Entered By],",")+2,1))

the field "Comp Entered By" is based off of a lookup table of names.

I want the above code to only give me the initials of any given name like:

Christian Many would be CM and the above code is giving me Ch.

What should I change on the above code?

Thanks in advance
 
J

John Spencer

Assuming a max of two words, and exactly one space between first and last word.

Left([Comp Entered By],1) &
MID([Comp Entered By],Instr(1,[Comp Entered By]," ")+1,1)

IF you have more than two words (names) in the field then you have to decide
what you want to do. Oscar de la Renta, Mary Jo Kopechne, Mary Anne Smythe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top