Darren-
First, you need to write a bit of code to "count words" in a string. You
can copy the code posted below my sig to do the job -- put it in a Standard
module - one you can see in the list of modules in the database window.
Then, you can use the function in any query:
SELECT MyTable.ID, MyTable.MemoField, CountWords(MyTable.MemoField) As
NoOfWords
FROM MyTable
--
John Viescas, author
"Building Microsoft Access Applications"
"Microsoft Office Access 2003 Inside Out"
"Running Microsoft Access 2000"
"SQL Queries for Mere Mortals"
http://www.viescas.com/
(Microsoft Access MVP since 1993)
======================
Public Function CountWords(varToTest As Variant) As Integer
'-----------------------------------------------------------
' Input: A string
' Outputs: Integer count of the number words
' in the string.
' Created By: JLV 01/31/95
' Last Revised: JLV 01/31/95
'-----------------------------------------------------------
Dim intI As Integer, strWork As String, intCount As Integer
CountWords = 0
If VarType(varToTest) <> vbString Then Exit Function
strWork = Trim(varToTest)
If Len(strWork) > 0 Then
' Start at 1 if string is not empty
' -- adjusts for no blank at the end
intCount = 1
Else
intCount = 0
End If
Do
' Find the next blank (end of a word)
intI = InStr(strWork, " ")
If intI = 0 Then Exit Do
intCount = intCount + 1
' Reduce the string to the next non-blank
strWork = Trim(Mid(strWork, intI + 1))
Loop
CountWords = intCount
End Function
==========================