seperating text (1 Viewer)

JBurlison

Registered User.
Local time
Today, 07:20
Joined
Mar 14, 2008
Messages
172
i want to separate first and last name, also after doing so automatically generate the e-mail address being first initial, last name. can someone give me and example as to how to do this? or what functions to use?
 

mresann

Registered User.
Local time
Today, 04:20
Joined
Jan 11, 2005
Messages
357
Yes, there are some string functions to use.

You can use this technique directly in a query or in a module using VBA. I'll do the VBA here.

strFirstName="Johhny"
strLastName="Goetz"

strEmailName = Left(strFirstName,1) & strLastName & "@myemail.com"

This returns "JGoetz@myemail.com".

Check out other functions such as Right, InStr, Mid, StrConv, and Chr to name a few.
 

JBurlison

Registered User.
Local time
Today, 07:20
Joined
Mar 14, 2008
Messages
172
im trying to do it the opposite way i have a full name(s) and i want to break them up
Ex i want to make John Todd

Firstname= John
Lastname = Todd

How would i do that?
 
M

Mike375

Guest
FirstName: Left([FieldName],InStr(1,[FieldName]," ")-1)

LastName: Right(Trim([FieldName]),Len(Trim([FieldName]))-InStr(1,[FieldName]," "))
 

doco

Power User
Local time
Today, 04:20
Joined
Feb 14, 2007
Messages
482
FullName = Trim( FieldName ) ' no surprises
FirstName = Left( FullName, InStr( 1, FullName, " " ) -1 )
LastName = Trim( Right( FullName, Len( FullName) - Len( FullName ) ) ) :D
 
Last edited:

Users who are viewing this thread

Top Bottom