Simple filter

L

Leslie Isaacs

Hello All

What's wrong with this:

Private Sub Command38_Click()
Me.Filter = "[indicator] Like ""*"" & [forms]![frm indicators
allocated]![findtext]&"" * """
Me.FilterOn = True
End Sub

[indicator] is a bound field on the form [frm indicators allocated], and
[findtext] is an unbound text field on the form.

I have the same syntax on another form, where it works fine: so why not
here?

Hope someone can help
Many thanks
Leslie Isaacs
 
G

Guest

Leslie,

Please find below the syntax and include a string variable:

Dim stCriteria As String
stCriteria = "[Zipcode] Like " & "Forms!Table2!Text4 & '*'"
Me.Filter = "(" & stCriteria & ")"
Me.FilterOn = True

Hope this helps you.
 
G

Guest

Leslie,

Please ignore the earlier respond. Please find below the syntax that you need:

Dim stCriteria As String
stCriteria = "[indicator] Like " & "'*' & Forms![frm indicators
allocated!findtext & '*'"
Me.Filter = "(" & stCriteria & ")"
Me.FilterOn = True

Hope this is helpful.
 
L

Leslie Isaacs

Hello Maha Arupputhan Pappan

Many thanks for that - it worked fine.
What was wrong with my code though??!!

Thanks again
Les




Maha Arupputhan Pappan said:
Leslie,

Please ignore the earlier respond. Please find below the syntax that you need:

Dim stCriteria As String
stCriteria = "[indicator] Like " & "'*' & Forms![frm indicators
allocated!findtext & '*'"
Me.Filter = "(" & stCriteria & ")"
Me.FilterOn = True

Hope this is helpful.
--
Maha Aruppthan Pappan
Nacap Asia Pacific (Thailand) Co., Ltd.


Leslie Isaacs said:
Hello All

What's wrong with this:

Private Sub Command38_Click()
Me.Filter = "[indicator] Like ""*"" & [forms]![frm indicators
allocated]![findtext]&"" * """
Me.FilterOn = True
End Sub

[indicator] is a bound field on the form [frm indicators allocated], and
[findtext] is an unbound text field on the form.

I have the same syntax on another form, where it works fine: so why not
here?

Hope someone can help
Many thanks
Leslie Isaacs
 

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