Parameter "Like" Query through a text box

  • Thread starter Thread starter Fatz
  • Start date Start date
F

Fatz

I have a query with the following criteria

Like *040104*

This is pulling the date from the middle of a string. How do I tell
the query to use the "Like" portion of the criteria through a text
box? Right now I am using the usual

[Forms]![Form Name]![Textboxname]

but this obviously doesn't take into consideration the like aspect of
the query. Any help???

Thanks!
Chris
 
Here's an example

"Select * from aTable where name Like '*" & _
[Forms]![Form Name]![Textboxname] & "'*"

Mind the line continuation marks and single quotes
leading and trailing the asterixes (to designate the text parameter)

In words:
Like singlequote asterix doublequote ampersand linecontinuationmark
formparameter ampersand doublequote singlequote asterix doublequote
(i left out the spaces :-)))

Krgrds,
Perry
 
Back
Top