Help with a parameter query

  • Thread starter Thread starter Carla
  • Start date Start date
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.
 
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.
 
Back
Top