When I add new data to a table
what would this data look like? a single field? multiple fields?
Perhaps a function something like this which returns a comma separated string which you can use as a rowsource to a valuelist listbox or combo
Code:
function WordsNotInTable(s as string) as string
dim rs as dao.recordset
dim sqlStr as String
'convert to css, removing any double spaces (this will need to be a loop if there are triple spaces)
s=replace(trim(replace(s," "," "))," ",",")
'get words that exist
sqlStr="SELECT words FROM wordlist where words in (" & s & ")"
set rst = currentdb.openrecordset(sqlStr)
'remove found words from s
'add commas to front and end to make comparison easier and avoid 'words within words'
s="," & s & ","
while not rs.eof
s=replace(s,"," & rs!words & ",",",")
rs.movenext
wend
'tidy up
rs.close
set rs=nothing
WordsNotInTable=mid(s,2,len(s)-2) 'may need a bit of work if no words returned
debug.print WordsNotInTable
end function