Case sensitive search

R

Rolf Mathisen

I have a search string - Like "*" &
[Forms]![Search]![Ssearchstring1] & "*" - which looks for names.
Is there anyone who knows how to make this "Case sensitive", so that I
will find Anna, but not Johanna?

Regards Rolf
 
J

John Spencer (MVP)

You could try using the instr function and

WHERE NameField Like "*" & [Forms]![Search]![Ssearchstring1] & "*"
AND Instr(1,[NameField],[Forms]![Search]![Ssearchstring1],0) > 0

You could actually drop the first line, but I often find that is a bit faster to
include the original search. What I SUSPECT happens is that this is optimized
by first returning the matches to the SQL criteria and then the second criteria
(using VBA) is executed against the returned records.
 

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