Hi David,
This can be done, but Access and VBA don't have good tools for doing it:
the code has to read the text, split it into words without being
confused by quote marks, punctuation, etc, and then work through them
keeping count of each.
When I need to do this I export the data to a textfile and use this Perl
script to get the counts (Perl is free from
www.activetate.com) :
#BEGIN
#take text input, parse into words, return list of words with number of
occurrences
use Text:
![Stick Out Tongue :P :P](/styles/default/custom/smilies/tongue.gif)
arseWords; #module with parse_line function
my $ignorecase = 1; #change this to 0 to be case sensitive
while (<>) { #read lines from STDIN or file(s) on command line
chomp;
@line = parse_line(qr/\W+/, 0, $_); #parse into words
if ($ignorecase) { map {$_ = ucfirst $_} @line }; #adjust case
foreach $word (@line) { $words{$word}++ }; #store count of words
}
foreach $word (sort keys %words) { #output sorted list of words
print "$word\t$words{$word}\n";
}
#END
If you need to do it entirely within Access, search Google for
"count words" vb OR vba
and you'll probably find some downloadable Visual Basic code that you
can modify to work in your database.