Help with a parameter query

C

Carla

Hello: I have a query set up in my database that
searches for certain records by a person's last name. It
allowed you to only enter part of a name. It worked just
fine in Access 97 but we recently upgraded to Access 2002
and it no longer works. When you run the query it
returns no records, no error messages nothing. This is
what I had in the criteria field in the Last Name column.
Like "*|[Enter Last Name or Part of it]|*"

Can someone help me get this to work again?

Thanks.
 
F

Fredg

Where did the two | come from?

Like "*" & [Enter Last Name or Part of it] & "*"

Will find all instances of the entry, however, I think

Like [Enter Last Name or Part of it] & "*"

might be more suitable for a name search, as it will only
match the beginning of a name, not if the name is included in the
middle or end of another name, i.e. Entering "berg" will find Berger but
ignore
Spielberg. Your method will find both.
 

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