Connecting Tech Pros Worldwide Help | Site Map

Code that parses a string and puts individual words into a seperate table

  #1  
Old August 25th, 2007, 01:45 AM
robboll
Guest
 
Posts: n/a
I am looking for a VBA routine with a table (tblSentences) and one
long field (field1) is the source

tblSentences
Field1
Did you know that a wild blueberry lies dormant for more than a year
between
growing seasons? That's why we specially select our choice
ingredients.

And another table (tblWords) with one field (FieldWord)

tblWords
FieldWord

The VBA routine goes through each row of tblSentences and puts each
word into tblWords. So tblWords populated looks like:

FieldWord
Did
you
know
that
a
wild
blueberry
..
..
..
Thanks in advance for any help with this!

RBolling

  #2  
Old August 25th, 2007, 02:15 AM
Larry Linson
Guest
 
Posts: n/a

re: Code that parses a string and puts individual words into a seperate table


I don't know what you are trying to accomplish, if anything practical... it
appears from your table structure, every word from every sentence maybe in
tblWords, which would most likely make it useless for any practical purpose.
Thus, I doubt anyone is going to already have, or be interested in preparing
for you, code to do what you describe.

Assuming this is for a homework assignment (and it seems suspiciously as
though it might be), you first should check Help (in recent versions of
Access) for the "Split" command, which will split the sentence into
"whatever text" is separated by the delimiter you specify. A space would
work nicely as the delimiter. In VBA, you'll find that DAO code is somewhat
easier to learn than ADO.

Larry Linson
Microsoft Access MVP



"robboll" <robboll@hotmail.comwrote in message
news:1188002194.076979.197150@q3g2000prf.googlegro ups.com...
Quote:
>I am looking for a VBA routine with a table (tblSentences) and one
long field (field1) is the source
>
tblSentences
Field1
Did you know that a wild blueberry lies dormant for more than a year
between
growing seasons? That's why we specially select our choice
ingredients.
>
And another table (tblWords) with one field (FieldWord)
>
tblWords
FieldWord
>
The VBA routine goes through each row of tblSentences and puts each
word into tblWords. So tblWords populated looks like:
>
FieldWord
Did
you
know
that
a
wild
blueberry
.
.
.
Thanks in advance for any help with this!
>
RBolling
>

  #3  
Old August 25th, 2007, 09:05 PM
robboll
Guest
 
Posts: n/a

re: Code that parses a string and puts individual words into a seperate table


On Aug 24, 8:08 pm, "Larry Linson" <boun...@localhost.notwrote:
Quote:
I don't know what you are trying to accomplish, if anything practical... it
appears from your table structure, every word from every sentence maybe in
tblWords, which would most likely make it useless for any practical purpose.
Thus, I doubt anyone is going to already have, or be interested in preparing
for you, code to do what you describe.
>
Assuming this is for a homework assignment (and it seems suspiciously as
though it might be), you first should check Help (in recent versions of
Access) for the "Split" command, which will split the sentence into
"whatever text" is separated by the delimiter you specify. A space would
work nicely as the delimiter. In VBA, you'll find that DAO code is somewhat
easier to learn than ADO.
>
Larry Linson
Microsoft Access MVP
>
"robboll" <robb...@hotmail.comwrote in message
>
news:1188002194.076979.197150@q3g2000prf.googlegro ups.com...
>
>
>
Quote:
I am looking for a VBA routine with a table (tblSentences) and one
long field (field1) is the source
>
Quote:
tblSentences
Field1
Did you know that a wild blueberry lies dormant for more than a year
between
growing seasons? That's why we specially select our choice
ingredients.
>
Quote:
And another table (tblWords) with one field (FieldWord)
>
Quote:
tblWords
FieldWord
>
Quote:
The VBA routine goes through each row of tblSentences and puts each
word into tblWords. So tblWords populated looks like:
>
Quote:
FieldWord
Did
you
know
that
a
wild
blueberry
.
.
.
Thanks in advance for any help with this!
>
Quote:
RBolling- Hide quoted text -
>
- Show quoted text -
Nope -- not a student. Just trying to become more versitile with
VBA. I actually found something here:
http://www.mvps.org/access/strings/str0003.htm

Believe it or not there are a lot of uses for this process!

Thanks!

RBolling

Closed Thread