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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy text before space? [First Name from Full Name] 2

Status
Not open for further replies.

Maillme

Technical User
Mar 11, 2003
186
NL
Hi There,

I have a text box on a form which includes the full name of a person - I would like to ba able to take the first name (any text before a space) and copy this into another field - but im not sure how?
Any help would be appreciated,

many thanks,
Neil
 
A starting point:
Code:
Me![another field] = Split(Me![text box] & " ")(0)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya Maillme . . .

Have a look at the [blue]InStr function![/blue]

A starting point:
Code:
[blue]Public Function GetNam1(Nam As String)
   Dim idx As Integer
   
   idx = InStr(1, Nam, " ")
   If idx > 0 Then GetNam1 = Left(Nam, idx - 1)

End Function[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top