[AccessD] How to Split a Text Field into Smaller Segments

Brad Marks bradm at blackforestltd.com
Fri Jul 17 11:34:16 CDT 2015


Don,

Works GREAT!

Thanks for the help.

Brad
________________________________________
From: AccessD <accessd-bounces at databaseadvisors.com> on behalf of McGillivray, Don <DMcGillivray at ctc.ca.gov>
Sent: Friday, July 17, 2015 10:50 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] How to Split a Text Field into Smaller Segments

Hi Brad,

Use the Split() function.  It populates an array with the elements of your delimited string:

MyArrayVariable = Split("<MyDelimitedString>","<MyDelimiter>")

MyArrayVariable = Split("AA|BBB|CDFF|XFEDD","|")

Then you can iterate through the array as necessary.

Don

-----Original Message-----
From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Brad Marks
Sent: Friday, July 17, 2015 8:26 AM
To: Access Developers discussion and problem solving
Subject: [AccessD] How to Split a Text Field into Smaller Segments


All,


In order to analyze the data that is contained in a text field, I need to break the data in the field into smaller segments.

There is a vertical bar "|" separating each smaller segment.

Example -

AA |  BBB | CDFDFF |  XFEDD

I would like to extract each smaller segment of the string and end up with four fields (for this example)


AA
BBB
CDFDFF
XFEDD

If there an easy way to do this with VBA?

Thanks,
Brad
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list