Parameter "Like" Query through a text box

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
 
P

Perry

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top