Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Populate Initials from Names in feild automatically 1

Status
Not open for further replies.

Yarbz

Technical User
Mar 29, 2002
19
US
Greetings All,
I have a need to have Assess 03 automatically create or populate the first initials from a consumers names (i.e. John E. Doe = JOD) Is this possible?
And where would I insert the code?
Yarbz

 

That's not enough information to help you.

How do you store the names in your table?
Is it something like:
[tt]
FName MI LName

John E Doe
Susie B Smith[/tt]

Have fun.

---- Andy
 
if it is stored in a single field you could try splitting it by the line spaces....

ie.

Code:
Dim myName As String
Dim bldStr As String
Dim sItems() As String
Dim sItem As Variant

myName = "John E Doe"
bldStr = ""
sItems = Split(myName, " ")
For Each sItem In sItems
 bldStr = bldStr & Left(sItem, 1)
Next
MsgBox bldStr

daveJam

it works on my machine, so technically i win!
 
Many Apologies,
Yes it is three fields as stated by Andy.
First, Middle Initial and Last.
Yarbz
 
Code:
Initials = Left("FName", 1) & Left("MI", 1) & Left("LName",1)


Randy
 
That did it. I just placed the correct name in [ ] and bingo.
Thanks
Yarbz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top