Extracting parts of a string

L

Leslie Isaacs

I have inherited an mdb that includes a table field with text data in the
following format:

2, 3 or 4 alphas, then a space, then between 1 and 15 alphas, then another
space, then finally between 1 and 15 alphas.

I want to split this data into 3 fields corresponding to the 3 strings of
text that are currently separated by the spaces.
I'm sure this can be done, but without knowing the position of the first
character of each element I cannot see how.

Hope someone can help.

Many thanks
Leslie Isaacs
 
M

Michel Walsh

Hi,


You can use Split( ), to get an array from the initial string, or you can
use InStr( ) to locate the spaces, and then, use Mid( ) to slice the string
in its segments. See the help file for mode details, or post here if you
have additional questions.


Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top