Search a Memo

wizcow

Registered User.
Local time
Today, 12:34
Joined
Sep 22, 2001
Messages
236
I have a large memo box that I would like to search.

The memobox will have data similar to this...

Bill
Doug and Fred
Ted
I want to be able to hit the return key and enter another line in the memobox.

When I do a search on this field, the top value can be found, but not the values after the 'enter'.
eg: Above I could find Bill, but not Ted

How do I get the search to recognize more than the first line?

Thanks
Tom
 
Ah yes, I'm being a bit vague.

I have a search form with a text box for search criteria.
When the search is started, a subform shows the filtered data.
The subforms record source is changed with an SQL statement in code.

Dim strSQLSF As String

strSQLSF = "SELECT * FROM tblTapeSub "
strSQLSF = strSQLSF & " WHERE tblTapeSub.Memobox = Forms!tape![txtSearch]"

Forms!tape!TapeSub.Form.RecordSource = strSQLSF
Forms!tape!TapeSub.Form.Requery

This only searches the first line of the memobox.

How can I get the search to see all lines in the memobox.

Thanks
Tom
 
Tom,

WHERE tblTapeSub.Memobox Like "*" & Forms!tape![txtSearch] & "*"

It's hard to match a whole memo field.

Wayne
 
Thanks for the reply, guys.

I am still having a problem with the syntax I think, as I get an error when I run this line of code. I tried a few things and nothing works yet.

strSQLSF = strSQLSF & " WHERE tblTapeSub.memobox Like " * " & Forms!tape![txtSearch] & " * ""

strSQLSF = strSQLSF & " WHERE tblTapeSub.memobox Like '" * "' & Forms!tape![txtSearch] & '" * "'"
\

strSQLSF = strSQLSF & " WHERE tblTapeSub.memobox Like ' * ' & Forms!tape![txtSearch] & ' * '"

I think its the quotes are giving me trouble.
Do you see what is going awry?
My SQL is limited.

Thanks
Tom
 
soundsfishy

Wow! This is a great example, I hope lots of people download it.

Thanks
Tom
 

Users who are viewing this thread

Back
Top Bottom