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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using like to search

Status
Not open for further replies.

SQLScholar

Programmer
Aug 21, 2002
2,127
GB
Hey all,

I have a form which has a textbox on it, and a button. When the button is clicked, it runs a query which has a field based on the textbox. Its basically supposed to be a search function on one field.

Problem - i just cant seem to get to return the correct rows. For instance i type in something and i get 250 rows... whatever i type?

The query looks like this:

Code:
SELECT Log.Prefix, Log.Type, Log.Reference, Log.[Date Reported], Log.[Email of Reporter], Log.[Overview/Screen], Log.Details, Log.[Policy Number/Client Key], Log.[Resource Email], Log.Timescale, Log.Priority, Log.Position, Log.Status, Log.Resolution, Log.[Date Resolved], Log.[Resolved in/By], Log.[Original CR number], Log.[Email Address of Tester], Log.[Creation Date]
FROM Log
WHERE (((Log.Details) Like "*" & [Forms]![DetailSearch Frm]![DetailsCB] & "*"));

Any help much appreciated.

Dan

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
If Log.Details is text, try single quotes:
Code:
WHERE (((Log.Details) Like "[COLOR=red]'[/color]*" & [Forms]![DetailSearch Frm]![DetailsCB] & "*[COLOR=red]'[/color]"));

traingamer
 
Sorry - ignore me, i am being dense. I chose the wrong text
box?

:-(

D

----------------------------------------
There are 2 types of computer, the prototype and the obsolete!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top