Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2005

Tip: Looking for answers? Try searching our database.

string function to split name field into 2 seperate fields

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EricB - 31 May 2005 15:22 GMT
Can anyone help me with a string function that splits a name field into 2
seperate fields. In the column name every name is entered with LastName
FirstName and I ned to move the LastName and the FirstName into seperate
fields.
I think it can be accomplished by using the InStr function but I have no
idea where to start. Any help is most appreciated.
fredg - 31 May 2005 17:20 GMT
> Can anyone help me with a string function that splits a name field into 2
> seperate fields. In the column name every name is entered with LastName
> FirstName and I ned to move the LastName and the FirstName into seperate
> fields.
> I think it can be accomplished by using the InStr function but I have no
> idea where to start. Any help is most appreciated.

You can run an Update Query.

What is the name separator?
A space? Brown John

Update YourTable Set YourTable.LastName =
Left([FullName],InStr([FullName]," ")-1),YourTable.FirstName =
Mid([FullName],InStr([FullName]," ")+1)

or a comma and space? Brown, John

Update YourTable Set YourTable.LastName =
Left([FullName],InStr([FullName],", ")-1),YourTable.FirstName =
Mid([FullName],InStr([FullName],", ")+2)

Signature

Fred
Please only reply to this newsgroup.
I do not reply to personal email.

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.