Apply Filter Problem

  • Thread starter Thread starter James
  • Start date Start date
J

James

Hello I have tried this:

DoCmd.ApplyFilter , "Title Like '*" & Me.txtTitle.Value
& "*'"
DoCmd.ApplyFilter , "SubTitle Like '*" & Me.txtTitle.Value
& "*'"

And It Filters the SubTitle but not the Title...

How can I get it to filter from two rows?

Many Thanks

James
 
Combine them into one statement:

DoCmd.ApplyFilter , "Title Like '*" & Me.txtTitle.Value _
& "*' And SubTitle Like '*" & Me.txtTitle.Value & "*'"
 
I have put this code in and it dosent apply the filter at
all now...

What could be wrong?

James
 
When you say it's not applying the filter at all, you mean nothing is
happening? Or that it's not displaying the records that you expect?

Your original post said "How can I get it to filter from two rows?". By
this, are you wanting to use two different values for the Title value and
for the SubTitle value? The code that you presented is using the same value
for both?
 
Ok no need to persue with this I have solved the error...

DoCmd.ApplyFilter , "Title Like '*" & Me.txtTitle.Value
& "*' OR SubTitle Like '*" & Me.txtTitle.Value & "*'"

That is what I needed an OR rather than an AND...

Ah well

Thanks for you assistance...

James
 
Back
Top