Filtering a form with partial search string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a command button on a form that contains Project information that i
want to open and filter a second form that contains client details

I can write the expression in the expression builder that filters the
Company Form when i enter the exact Company name into the filter pop-up but i
want to be able to enter partial names and have the filter return a short
list.
eg. I want the Company form to open at "Acme Inc" even if i enter just "Acme"

I've tried the following expression and variations but i either get returns
of all companies or none.

"*" & [CompanyName]=[060726 Company]![CompanyName]

Whenever i try using LIKE in the expression i get a message telling me that
Access can't Parse the expression??? - i don't know what that means.

Can someone please let me know what i'm doing wrong?

Gratefully,
David
 
I have a command button on a form that contains Project information that i
want to open and filter a second form that contains client details

I can write the expression in the expression builder that filters the
Company Form when i enter the exact Company name into the filter pop-up but i
want to be able to enter partial names and have the filter return a short
list.
eg. I want the Company form to open at "Acme Inc" even if i enter just "Acme"

I've tried the following expression and variations but i either get returns
of all companies or none.

"*" & [CompanyName]=[060726 Company]![CompanyName]

Whenever i try using LIKE in the expression i get a message telling me that
Access can't Parse the expression??? - i don't know what that means.

Can someone please let me know what i'm doing wrong?

Gratefully,
David

Try

[CompanyName] LIKE "*" & [Forms]!<name of your form>![CompanyName] &
"*"

to find the entered name anywhere within the CompanyName field. Leave
off the first "*" if you want to find only CompanyNames that start
with the entered value.

I certainly hope you DON'T have a table or a form named [060726
Company]!

John W. Vinson[MVP]
 
Back
Top