How to filter using wildcards?

  • Thread starter Thread starter azu_daioh
  • Start date Start date
A

azu_daioh

I couldn't figure out how to use wild cards in filter. I have an
[Employer] table with erName, erAddress, erCity, erState, erZip.
From another form using another table, I have a control called srcER
and I would like to open the [Employer] form filtering it based on
whatever the user enters in the srcER.

For example, if the user types "Kanna", I would like to open the
Employer form filtered by any ermployer name with the word Kanna in
it, ie. Kannazuki Corp, Kanna & Miller, Asukanna

Can someone pls help?!? I appreciate it. Thank you.
 
Here's the code I'm using but can't figure out how to put the
wildcards in

DoCmd.OpenForm "frm_Employer"
Forms.frm_Employer.Filter = "erName Like '" & Me.srcER & "'
Forms.frm_Employer.FilterOn = True
 
Me.Filter = "[erName] Like ""*" & Me.srcER & "*"""\
Me.FilterOn = True

Note that that's two double quotes before the first asterisk, and three
double quotes after the second one.
 
nih
Douglas J. Steele said:
Me.Filter = "[erName] Like ""*" & Me.srcER & "*"""\
Me.FilterOn = True

Note that that's two double quotes before the first asterisk, and three
double quotes after the second one.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I couldn't figure out how to use wild cards in filter. I have an
[Employer] table with erName, erAddress, erCity, erState, erZip.
From another form using another table, I have a control called srcER
and I would like to open the [Employer] form filtering it based on
whatever the user enters in the srcER.

For example, if the user types "Kanna", I would like to open the
Employer form filtered by any ermployer name with the word Kanna in
it, ie. Kannazuki Corp, Kanna & Miller, Asukanna

Can someone pls help?!? I appreciate it. Thank you.
 
test


liuli said:
nih
Douglas J. Steele said:
Me.Filter = "[erName] Like ""*" & Me.srcER & "*"""\
Me.FilterOn = True

Note that that's two double quotes before the first asterisk, and three
double quotes after the second one.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I couldn't figure out how to use wild cards in filter. I have an
[Employer] table with erName, erAddress, erCity, erState, erZip.
From another form using another table, I have a control called srcER
and I would like to open the [Employer] form filtering it based on
whatever the user enters in the srcER.

For example, if the user types "Kanna", I would like to open the
Employer form filtered by any ermployer name with the word Kanna in
it, ie. Kannazuki Corp, Kanna & Miller, Asukanna

Can someone pls help?!? I appreciate it. Thank you.
 
liuli said:
nih
Douglas J. Steele said:
Me.Filter = "[erName] Like ""*" & Me.srcER & "*"""\
Me.FilterOn = True

Note that that's two double quotes before the first asterisk, and three
double quotes after the second one.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I couldn't figure out how to use wild cards in filter. I have an
[Employer] table with erName, erAddress, erCity, erState, erZip.
From another form using another table, I have a control called srcER
and I would like to open the [Employer] form filtering it based on
whatever the user enters in the srcER.

For example, if the user types "Kanna", I would like to open the
Employer form filtered by any ermployer name with the word Kanna in
it, ie. Kannazuki Corp, Kanna & Miller, Asukanna

Can someone pls help?!? I appreciate it. Thank you.
 
liuli said:
nih
Douglas J. Steele said:
Me.Filter = "[erName] Like ""*" & Me.srcER & "*"""\
Me.FilterOn = True

Note that that's two double quotes before the first asterisk, and three
double quotes after the second one.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


I couldn't figure out how to use wild cards in filter. I have an
[Employer] table with erName, erAddress, erCity, erState, erZip.
From another form using another table, I have a control called srcER
and I would like to open the [Employer] form filtering it based on
whatever the user enters in the srcER.

For example, if the user types "Kanna", I would like to open the
Employer form filtered by any ermployer name with the word Kanna in
it, ie. Kannazuki Corp, Kanna & Miller, Asukanna

Can someone pls help?!? I appreciate it. Thank you.
 
Back
Top