Re: Like statement

Tech-Archive recommends: Speed Up your PC by fixing your registry



No, don't do that. I really don't want to go through the
process of verifying that it would be safe to open.

Just post the a Copy/Paste of the Where clause you have now
along with the test list you are using. Any explanation you
can provide about what it is doing would also help.
--
Marsh
MVP [MS Access]


rml wrote:
I'm not getting it to work? Not sure what I might be doing wrong. Would it
be possible to send you the database (very small) so you can see what I'm
tring to do?

"Marshall Barton" wrote:
That only changes it a little. Add a space after the
commas:

WHERE ", " & Forms!Form1!Text1 & ", " LIKE "*, " &
FieldName & ". *"

The important point here is that the list in the text box
must have the exact punctuation alowed for in the comparison
expression.

Because the check for punctuation is used instead of just
the field, the criteria will not be able to take advantage
of any indexing, which may have signifiicant performance
impact.

Be sure you understand that using the punctuation in the
expression is there to prevent a field with a value like
AU21 from matching a list like XAU2156


rml wrote:

No spaces? It will always look like this:

BAU214, BAU324, BAU444

It will have the value, comma, space.

Does that change anything?

"Marshall Barton" wrote:

Then use Giorgio's idea.

To prevent matching just part of the specified values, use a
variation something like:

SELECT *
FROM Table1
WHERE "," & Forms!Form1!Text1 & "," LIKE "*," & FieldName &
".*"

And make sure there are no spaces in the list in the text
box.


rml wrote:
No, it could be CAU34, BAU44, AVC67

I just want to be able to have the data in this field populate a query that
would return the records (if any) for those entered in that field.


"Marshall Barton" wrote:

rml wrote:

How do I get records returned with the following:

Like[BAU214, BAU215, BAU216]

I would like to have all three records returned in the query.


Like "BAU21[456]"

or if the values are ot that uniform:

IN("BAU214", "BAU215"," BAU216")

.



Relevant Pages

  • Re: Like statement
    ... "Marshall Barton" wrote: ... Because the check for punctuation is used instead of just ... rml wrote: ... I would like to have all three records returned in the query. ...
    (microsoft.public.access.queries)
  • Re: Like statement
    ... Because the check for punctuation is used instead of just ... "Marshall Barton" wrote: ... I would like to have all three records returned in the query. ...
    (microsoft.public.access.queries)