Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL a Memo Field

Status
Not open for further replies.

niteraven

Technical User
Oct 26, 2006
92
0
0
US
Hello all

I am having a bit of a problem with this line of code. I have a form that users input information and it produces a dynamic query. The like statement for the memo field is not working at all.

Code:
where = where & " AND [specialcircum] like " * " & " + Me![spcircum] + " & " * ""

and i have tried this way and about 5 other ways:

Code:
where = where & " AND [specialcircum] like "*" & '" + Me!spcircum + "'&"*""

Any help would be appreciated.
Thanks
Raven
 

Code:
where = where & " AND [specialcircum] like [blue]'*" & Me![spcircum] & "*'"[/blue]

Have fun.

---- Andy
 
OOPS. I think I had one too many "s
Code:
where = where & " AND [specialcircum] like ""*" &  Me![spcircum] & "*"""
This should be the same result as suggested by Andy if the spcircum doesn't contain any apostrophes.


Duane
Hook'D on Access
MS Access MVP
 

And if the spcircum does contain any apostrophes:
Code:
where = where & " AND [specialcircum] like '*" & [blue]Replace([/blue]Me![spcircum][blue], "'", "''")[/blue] & "*'"

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top