Apply a filter from user input using "Like"

H

himmelrich

currently I have this in the filter section and it's not
working.....any ideas?

[Project Name] Like " * Forms![Project Search]!Combo47 * "
 
P

Pictou

I suspect something like this would improve the result:
Me.Filter = "[Project Name] Like *" & Forms![Project Search]!Combo47 & "*"


Douglas J. Steele said:
Try

[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


currently I have this in the filter section and it's not
working.....any ideas?

[Project Name] Like " * Forms![Project Search]!Combo47 * "
 
D

Douglas J. Steele

Yes, you're correct. My fingers weren't doing what my brain said to!

Thanks for the assist.

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Pictou said:
I suspect something like this would improve the result:
Me.Filter = "[Project Name] Like *" & Forms![Project Search]!Combo47 & "*"


Douglas J. Steele said:
Try

[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


currently I have this in the filter section and it's not
working.....any ideas?

[Project Name] Like " * Forms![Project Search]!Combo47 * "
 
H

himmelrich

Thank you for your direction, greatly appreciated.

When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.

My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:

DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"

this implementation is not working so I'm a little lost still as to
how this may work.

I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.




Try

[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)


currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "
 
H

himmelrich

Thank you for your direction, greatly appreciated.

When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.

My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:

DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"

this implementation is not working so I'm a little lost still as to
how this may work.

I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.


I suspect something like this would improve the result:
Me.Filter = "[Project Name] Like *" & Forms![Project Search]!Combo47 & "*"

Douglas J. Steele said:
[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"
currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "
 
D

Douglas J. Steele

DoCmd.ApplyFilter , _
"[Project Name] Like '*" & Forms![Project Search]!Combo99 & "*'"

Exagerated for clarity, that second line is

"[Project Name] Like ' * " & Forms![Project Search]!Combo99 & " * ' "

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Thank you for your direction, greatly appreciated.

When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.

My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:

DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"

this implementation is not working so I'm a little lost still as to
how this may work.

I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.




Try

[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)


currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "
 
H

himmelrich

DoCmd.ApplyFilter , _
"[Project Name] Like '*" & Forms![Project Search]!Combo99 & "*'"

Exagerated for clarity, that second line is

"[Project Name] Like ' * " & Forms![Project Search]!Combo99 & " * ' "

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)




Thank you for your direction, greatly appreciated.
When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.
My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:
DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"
this implementation is not working so I'm a little lost still as to
how this may work.
I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.
Try
[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"
--
Here is what I've got in the code and it's still returning no
data.........

Private Sub Combo99_AfterUpdate()
DoCmd.ApplyFilter , "[Project Name] Like ' * " & Forms![Project
Search]!Combo99 & " * ' "
End Sub

Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)

currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "- Hide quoted text -

- Show quoted text -
 
D

Douglas J. Steele

Do you actually have the spaces in ' * " and " * ' "? If so, get rid of
them.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


DoCmd.ApplyFilter , _
"[Project Name] Like '*" & Forms![Project Search]!Combo99 & "*'"

Exagerated for clarity, that second line is

"[Project Name] Like ' * " & Forms![Project Search]!Combo99 & " * ' "

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)




Thank you for your direction, greatly appreciated.
When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.
My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:
DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"
this implementation is not working so I'm a little lost still as to
how this may work.
I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.
On Oct 12, 3:13 pm, "Douglas J. Steele"
Try
[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"
Here is what I've got in the code and it's still returning no
data.........

Private Sub Combo99_AfterUpdate()
DoCmd.ApplyFilter , "[Project Name] Like ' * " & Forms![Project
Search]!Combo99 & " * ' "
End Sub

Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)
currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "- Hide
quoted text -

- Show quoted text -
 
H

himmelrich

Do you actually have the spaces in ' * " and " * ' "? If so, get rid of
them.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)




DoCmd.ApplyFilter , _
"[Project Name] Like '*" & Forms![Project Search]!Combo99 & "*'"
Exagerated for clarity, that second line is
"[Project Name] Like ' * " & Forms![Project Search]!Combo99 & " * ' "
--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)

Thank you for your direction, greatly appreciated.
When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.
My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:
DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"
this implementation is not working so I'm a little lost still as to
how this may work.
I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.
On Oct 12, 3:13 pm, "Douglas J. Steele"
Try
[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"
--
Here is what I've got in the code and it's still returning no
data.........
Private Sub Combo99_AfterUpdate()
DoCmd.ApplyFilter , "[Project Name] Like ' * " & Forms![Project
Search]!Combo99 & " * ' "
End Sub
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)
BINGO.

currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "- Hide
quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
H

himmelrich

Do you actually have the spaces in ' * " and " * ' "? If so, get rid of
them.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)




DoCmd.ApplyFilter , _
"[Project Name] Like '*" & Forms![Project Search]!Combo99 & "*'"
Exagerated for clarity, that second line is
"[Project Name] Like ' * " & Forms![Project Search]!Combo99 & " * ' "
--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no private e-mails, please)

Thank you for your direction, greatly appreciated.
When I put [Project Name] Like "*" & Forms![Project Search]!Combo47 &
"*" in a query against field project name is works great.
My implementation of this was in a form with an unbound text box with
an event 'After Update' that looks like this:
DoCmd.ApplyFilter , [Project Name] Like "*" & Forms![Project Search]!
Combo99 & "*"
this implementation is not working so I'm a little lost still as to
how this may work.
I'm able to do this with an exact match on another field/form, but
with Like it's a different story....I'm not sure why, but perhaps you
can help.
On Oct 12, 3:13 pm, "Douglas J. Steele"
Try
[Project Name] Like "*" & Forms![Project Search]!Combo47 & "*"
--
Here is what I've got in the code and it's still returning no
data.........
Private Sub Combo99_AfterUpdate()
DoCmd.ApplyFilter , "[Project Name] Like ' * " & Forms![Project
Search]!Combo99 & " * ' "
End Sub
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)
Thank you for that......that works. I've tried to post a new
question, but I'm not getting it to post (tried a couple of times).
So her is another question.

this works:
Forms![Master Search].Form.Filter = "[GTPO] = Forms![Master Search]!
Text63"
FilterOn = True

this doesn't:
Forms![Master Search].Form.Filter = "[GTPO] = Forms![Master Search]!
Text63" Or "[Project Name] Like '*" & Forms![Master Search]!Text64 &
"*'"
FilterOn = True


currently I have this in the filter section and it's not
working.....any ideas?
[Project Name] Like " * Forms![Project Search]!Combo47 * "- Hide
quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
 
S

S Himmelrich

Thank you...can you help with this:

Working:
Forms![Master Search].Form.Filter = "[GTPO] = Forms![Master Search]!
Text63"
FilterOn = True

Not working:
Forms![Master Search].Form.Filter = "[GTPO] = Forms![Master Search]!
Text63" Or "[Project Name] Like '*" & Forms![Master Search]!Text64 &
"*'"
FilterOn = True


Any thoughts?
 
Top