Separating strings in a field to separate fields

  • Follow


Hi,

I have a field that consists of a string value that looks like Item1,
Item2, Item3, each item is separated by commas.  I want to separate
that string value so that each item has its own field.  Is there code
that will easily do this?

Thanks,
Jaime
0
Reply jseger22 12/5/2007 8:08:57 PM

On Wed, 5 Dec 2007 12:08:57 -0800 (PST), jseger22@yahoo.com wrote:

>Hi,
>
>I have a field that consists of a string value that looks like Item1,
>Item2, Item3, each item is separated by commas.  I want to separate
>that string value so that each item has its own field.  Is there code
>that will easily do this?
>
>Thanks,
>Jaime

Yes... but it differs depending on the circumstances. Are there always exactly
three items? An arbitrary number of items? Is there always at least one comma
or might some records have none? 

Take a look at the VBA help for InStr, Mid, and Split and post back with a bit
more detail (and perhaps an example) if you need more help.

             John W. Vinson [MVP]
0
Reply John 12/5/2007 11:33:04 PM


On Dec 5, 6:33 pm, John W. Vinson <jvinson@STOP_SPAM.WysardOfInfo.com>
wrote:
> On Wed, 5 Dec 2007 12:08:57 -0800 (PST), jsege...@yahoo.com wrote:
> >Hi,
>
> >I have a field that consists of a string value that looks like Item1,
> >Item2, Item3, each item is separated by commas.  I want to separate
> >that string value so that each item has its own field.  Is there code
> >that will easily do this?
>
> >Thanks,
> >Jaime
>
> Yes... but it differs depending on the circumstances. Are there always exactly
> three items? An arbitrary number of items? Is there always at least one comma
> or might some records have none?
>
> Take a look at the VBA help for InStr, Mid, and Split and post back with a bit
> more detail (and perhaps an example) if you need more help.
>
>              John W. Vinson [MVP]

There will always be a max of three items and they will always but
separated by commas.  I was trying to do this with the Split function
but I am only a beginner with VBA so I am having some troubles.  If
you could help me out with an example that would be much appreciated.
Thanks!
0
Reply jseger22 12/6/2007 1:13:09 PM

2 Replies
674 Views

(page loaded in 0.777 seconds)

Similiar Articles:
















7/20/2012 11:24:15 AM


Reply: