QUERY - Search table for record

K

kealaz

Hi,

I have a query that searches a table for a record. It's working, but I
would like to refine it a bit.

When I search on XYZ ELECTRONICS, I find the record I am looking for. I
want to be able to type XYZ and find the same record. How would I do that?

On my query, I have under VENDORNAME
Criteria: [Enter Vendor Name:]
which is how I enter the parameters to search the table on. If you answer
my question with code...PLEASE tell me where to put it...as I am very much a
novice with Access.

THANK YOU SO MUCH!!!!!
 
C

Clifford Bass

Hi,

You will want to use the Like operator. Change your criteria to:

Like "*" & [Enter Vendor Name:] & "*"

That should find anything that contains the partial vendor string. If
you only want to find those that start with the partial vendor string, leave
off the "*" & part.

Clifford Bass
 
K

kealaz

Clifford,
THANK YOU very much. This worked GREAT!

~Kealaz

Clifford Bass said:
Hi,

You will want to use the Like operator. Change your criteria to:

Like "*" & [Enter Vendor Name:] & "*"

That should find anything that contains the partial vendor string. If
you only want to find those that start with the partial vendor string, leave
off the "*" & part.

Clifford Bass

kealaz said:
Hi,

I have a query that searches a table for a record. It's working, but I
would like to refine it a bit.

When I search on XYZ ELECTRONICS, I find the record I am looking for. I
want to be able to type XYZ and find the same record. How would I do that?

On my query, I have under VENDORNAME
Criteria: [Enter Vendor Name:]
which is how I enter the parameters to search the table on. If you answer
my question with code...PLEASE tell me where to put it...as I am very much a
novice with Access.

THANK YOU SO MUCH!!!!!
 
A

Allen Browne

Try using this in the Criteria:
Like [Enter Vendor Name:] & "*"

If you wanted to find the XYZ even in the middle of the name, use the
wildcard at the beginning as well:
Like "*" & [Enter Vendor Name:] & "*"
 

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