View Full Version : Search Query


EleanorG
10-12-2001, 06:59 AM
I have a search form...it searches for titles in a title field on my main form. I want to get all entries that include "cat" but I'm getting cattle, certificate, etc. I use the - Like "*" & [Enter Title] & "*" because I also want to search dog and get dogs. Is there a way around this.

[This message has been edited by EleanorG (edited 10-12-2001).]

Shep
10-12-2001, 09:15 AM
I am unclear how you are searching for your entries. If you are using a query, you can supply as criteria:

Like "cat" Or Like "cats"

This is useful if you know that your 'entries' will remain consistent, and if you want to avoid using wildcard searches.
Even if you encounter other 'entries' in the future, you can simply add an

Or Like "feline" (for example)

to the same criteria string.

Shep

EleanorG
10-12-2001, 09:46 AM
This is an audio/visual database. There are titles relating to Veterinary Medicine..so I have cat, cats, feline, etc. Also things like horse, horses, equine. I created a search form that prompts the user for word in the title...I don't want titles with part of the word imbedded...like identification,when you search cat, but I do want horse, horses or dog, dogs

Shep
10-12-2001, 01:06 PM
heh heh...somehow, this seems to work.

This string:

Like "* " & [Enter Title] & " *" Or Like "* " & [Enter Title] Or Like [Enter Title] & " *" Or Like [Enter Title] Or Like [Enter Title] & "*" Or Like "* " & [Enter Title] & "s"

will return the titles,

Cat
The Cat
The Cat That Ate Madagascar
Cats
Cats with Fur
Several Cats

but will not return the titles,

The Red Catamaran
Mother Married a Bearcat

if you enter "cat" as criteria.

I have no doubt there could be a 'real' way to accomplish this, but perhaps you can make use of it.

It occurred to me while working on the last bit that it could be shortened a bit, but I started to become cross-eyed so I am not sure. http://www.access-programmers.co.uk/ubb/smile.gif

Shep

[This message has been edited by Shep (edited 10-12-2001).]