Link to home
Start Free TrialLog in
Avatar of c0zee
c0zee

asked on

Doing multiple filters to a recordset

i have a recordset (ADO) and i still have several criterias to filter this and i am trying to do this  using the filter function (rs.filter = [criteria])
im using VB6 here by the way

i DO NOT want to do it this way(style 1):
rs.filter = [criteria1] AND [criteria2] AND...[criteriaN]

i WANT it to do it this way (style 2):
rs.filter = [criteria1]
...
rs.filter = [criteria2]
...
rs.filter = [criteriaN]
but unfortunately it gives me wrong set of data.

can somebody help me on how to make some workaround so that style 2 will give me the same recordset as style 1.
thanks in advance for the help!

 

Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

You would need to concatenate your filters like this:

rs.filter = rs.filter & " AND " & [criteria2]
Avatar of c0zee
c0zee

ASKER

any other suggestions?
can I ask you why you don't like mine?
Avatar of c0zee

ASKER

hey emoreau, first of all thanks for your suggestion (although i havent tried it yet, im on vacation), 2nd i didnt say that i dont like your suggestion.
im just asking for some other suggestions maybe there are people out there that have other workarounds or ideas about my question.
peace!  :)
ASKER CERTIFIED SOLUTION
Avatar of Éric Moreau
Éric Moreau
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
question answered by emoreau
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

apptsolu
EE Cleanup Volunteer