Search box, possible better way (1 Viewer)

ankrumc

Registered User.
Local time
Today, 02:49
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!
 

John Big Booty

AWF VIP
Local time
Today, 17:49
Joined
Aug 29, 2005
Messages
8,262
Try;
Code:
like "*[B][COLOR="Red"]" &[/COLOR][/B] [Forms]![FamilyTreeForm]![RelationshipSearchEntry] [COLOR="Red"][B]& "[/B][/COLOR]*"
In your criteria
 

ankrumc

Registered User.
Local time
Today, 02:49
Joined
Feb 23, 2009
Messages
42
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?
 

Scooterbug

Registered User.
Local time
Today, 03:49
Joined
Mar 27, 2009
Messages
853
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.
 

John Big Booty

AWF VIP
Local time
Today, 17:49
Joined
Aug 29, 2005
Messages
8,262
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

Top Bottom