build a table of words to ignore:
the, and , of , with, etc...
run code to loop thru every word in the titles and post the results
[word], [title]
Little, Little Princess of Fantasy
Princess, Little Princess of Fantasy
of, Little Princess of Fantasy
Fantasy, Little Princess of Fantasy
once complete, use the tRemoveWords list to do just that.
delete from main table those in the tRemoveWords list
then count the results
Public Sub CountTitleWords()
Dim rst
Dim vTitl, vWord, vTxt
Dim i As Integer
DoCmd.SetWarnings False
Set rst = CurrentDb.OpenRecordset("select TITLE from tBookTitles")
With rst
While Not .EOF
vTitl = .Fields("Title").Value & ""
vTxt = vTitl
i = InStr(vTxt, " ")
While i > 0
If i > 0 Then
vWord = Left(vTxt, i - 1)
vTxt = Mid(vTxt, i + 1)
End If
GoSub PostResults
i = InStr(vTxt, " ")
Next
vWord = vTxt
GoSub PostResults
.MoveNext 'next book title
Wend
End With
Set rst = Nothing
DoCmd.SetWarnings True
End Sub
PostResults:
'post the keyword to the table
sSql = "Insert into tTitleWords ([word],[Title]) values ('" & vWord & "','" & vTitl & "')"
DoCmd.RunSQL sSql
Return
End Sub