Slick ha scritto:
I've been away from Access for several years, I am trying to create a seach
on a field that is a memo. I have 246 memo's in the field and want to create
someway to enter a key word and have it return the memo's with that word in
it. Any ideas? I remember that I did this years ago in Access 97. Thanks
Sorry about my english... i don't undertand if you have 246 Memo
fields..?
So you need to search a word in each Memo fields...?
Right so...?
If this is exact, it's strange situation, but you can use the code
suggest you by Ken Snell
inside a Loop.
Dim mdb as DAO.Database
Dim mfld as DAO.Fields
Dim mrs as DAO.Recordset
Dim rsS as DAO.Recordset
Dim sSQL as string
Dim Word2Find as string
Word2Find =InputBox("Search...")
set mdb=Currentdb()
Set mrs=mdb.OpenRecordset("SELECT * FROM T1 WHERE 1=0", dbReadOnly)
For each mfld in mrs.Fields
If mfld.Type=dbMemo then
sSQL="SELECT * FROM T1 " & _
"WHERE [" & fld.name & "] Like "*'" & Word2Find &
"'*"
Set rsS=mdb.OpenRecordset(sSQL,dbReadOnly)
if not rsS.EOF then
' Now i don't know how you need to use this....!
Msgbox "FIND IT on " & mfld.name
exit for
End if
set rsS=Nothing
End if
Next
This is very strange......
@Alex