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 / February 2005

Tip: Looking for answers? Try searching our database.

Returning part of a field value in code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt - 22 Feb 2005 16:31 GMT
Can anybody help

I have a text field use to store both names and towns. It has been inputted
into the table using this format

Name (Town)

Is it possible in code to return the name only ie everything before the
bracket.
For example if the text field contained

Taylor (Manchester)

I want the Taylor part only

Thanks In advance

Matt
Alex Ivanov - 22 Feb 2005 16:49 GMT
Matt,
try this
Left(yourtext, InStr(1, yourtext, " (") - 1)

Note, however that it will blow up if there is no space-opening parentecis
sequence in yourtext. If there is such possibility, check for this condition
before running this code

Signature

Please reply to NG only. This email is not monitored.
Alex.

> Can anybody help
>
[quoted text clipped - 15 lines]
>
> Matt
 
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.