using the "Like" fuunction in queries

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

All,

What's the difference between using:

[Forms]![Frm_Name]![form_object] and using:
Like [Forms]![Frm_Name]![form_object]

in the criteria section of a query.
 
All,

What's the difference between using:

[Forms]![Frm_Name]![form_object] and using:
Like [Forms]![Frm_Name]![form_object]

in the criteria section of a query.

Not a thing.... unless you use a wildcard with the Like keyword.

If you use
[Forms]![Frm_Name]![form_object]
and enter Jack in the text control, only records that contain just the
word Jack will be returned.

If you use
Like [Forms]![Frm_Name]![form_object] & "*" then, if you enter Jack,
all the records that begin with Jack will be returned, i.e. Jack,
Jackson, Jacksonville, Jack and Jill, etc.

If you use
Like "*" & [Forms]![Frm_Name]![form_object] & "*" then all the records
that contain Jack anywhere in the field, i.e. Jack, Jack and Jill, I
went to Jack-in-the-Box for lunch, He played blackjack, etc.
 

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

Back
Top