Query with partial information (1 Viewer)

NoFerrari

New member
Local time
Yesterday, 18:10
Joined
Mar 8, 2019
Messages
3
Hi there:

I think I can use a boolean search technique like an asterisk after a partial terms to get all related terms, but how do I write that?

Please direct me to any threads that already deal with this. I don't know all the terms as yet to search effectively. Maybe "partial match" is the correct term.

So the thing I have set up is to find all listings of a company (out of a database of companies) which has hired people in specific types of jobs. As I have it now, it is necessary to write the entire company name exactly as it is written in the record.

How do I allow someone to search by just one word in the record?

It would be like using "find" with a part match.

Thoughts? Thanks for any help.

-NF
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 16:10
Joined
Aug 30, 2003
Messages
36,123
You want Like instead of = plus one or more wildcards. An example using a form:

Like "*" & Forms!FormName.TextboxName & "*"
 

isladogs

MVP / VIP
Local time
Today, 00:10
Joined
Jan 14, 2017
Messages
18,209
Or if you have a specific search phrase, you need something similar to Like "YourSearchPhrase*"

for example to look for all names starting with Jon you would use Like "Jon*"
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:10
Joined
Feb 28, 2001
Messages
27,129
The term you seek is "wildcard search" if you want to look up articles.
 

theseus

Registered User.
Local time
Yesterday, 19:10
Joined
Aug 6, 2018
Messages
32
Like "*" & Forms!FormName.TextboxName & "*"


I have used this in most of my forms as a way to get results. However I did find that it is rather broad in what it lets through.

For example, I have a form that has job descriptions. If I search for something like "driver" of which I have 4 types, it will spit back all 4, not just the one job description "driver". So it helps if your users are aware that the more specific they are in entering their search parameters the better the results. (But isn't that always the case....?)
 

isladogs

MVP / VIP
Local time
Today, 00:10
Joined
Jan 14, 2017
Messages
18,209
I only used a trailing wildcard in my previous reply for that reason.

In general you should avoid leading wildcards wherever possible as including them will force Access to search every record. Sometimes its unavoidable but it will be slower and probably give many more irrelevant results
 
Last edited:

theseus

Registered User.
Local time
Yesterday, 19:10
Joined
Aug 6, 2018
Messages
32
I only used a trailing wildcard in my previous reply for that reason.

In general you should avoid leading wildcards wherever possible as including them will force Access to search every record. However, sometimes its unavoidable but it will be slower and probably give many more irrelevant results


Good to know. I'll give it at try...
 

Users who are viewing this thread

Top Bottom