Search box, possible better way

ankrumc

Registered User.
Local time
Today, 14:52
Joined
Feb 23, 2009
Messages
42
So, I'd like to have my search text box on a form. When it is populated, it is pulled up in a query that contains criteria in the form of like "*________*" so that all of the information in the text box is searched for. The problem is that I can't seem to get the criteria to read or pull from the search box (RelationshipSearchEntry)

I'm using this

like "*[Forms]![FamilyTreeForm]![RelationshipSearchEntry]*"

in the criteria.

What am I doing wrong, or not doing right?

Thanks!
 
Try;
Code:
like "*[B][COLOR="Red"]" &[/COLOR][/B] [Forms]![FamilyTreeForm]![RelationshipSearchEntry] [COLOR="Red"][B]& "[/B][/COLOR]*"
In your criteria
 
Ok, its bringing up all the records that are populated now, but it doesn't change depending on what is written in the search entry. Even when I didn't have anything entered in the Search box, it brought up all the records, similar to a "Is not null" deal.

Could there be something else I'm missing?
 
you need to add additional quotes.

like "*" & chr(34) & [Forms]![FamilyTreeForm]![RelationshipSearchEntry] & chr(34) & "*"

I use chr(34) because I can never remember the format for using quotes inside of quotes. I'm sure someone else can fill ya in on the correct useage, but the chr(34) will work.
 
you need to add additional quotes.

like "*" & chr(34) & [Forms]![FamilyTreeForm]![RelationshipSearchEntry] & chr(34) & "*"

I use chr(34) because I can never remember the format for using quotes inside of quotes. I'm sure someone else can fill ya in on the correct useage, but the chr(34) will work.

Que? What are the additioanl Quote marks for?
 

Users who are viewing this thread

Back
Top Bottom