applying concatenate filter

E

eRDe

Hi All,
I tried to filter the record in my form but it seem it doesn't work as
expected.
I tried to create a concatenate filter and put all criteria in an array but
it seem, it just applying the last condition only.

here is the filter action code
============================

For each rs in array(rs1,rs2,rs3,rs4,rs5)
If rs = "" then
Else
MsgBox rs
DoCmd.ApplyFilter, rs
End If
Next rs

============================

I want to filter the record by rs1 (if its not null) next by rs2
and so on.
But what I get is, the previous filter is removed before the next
filter is applied.How to solve this??
Perhaps somebody out there would like to help.

Regards,
 
J

John W. Vinson

Hi All,
I tried to filter the record in my form but it seem it doesn't work as
expected.
I tried to create a concatenate filter and put all criteria in an array but
it seem, it just applying the last condition only.

here is the filter action code
============================

For each rs in array(rs1,rs2,rs3,rs4,rs5)
If rs = "" then
Else
MsgBox rs
DoCmd.ApplyFilter, rs
End If
Next rs

============================

I want to filter the record by rs1 (if its not null) next by rs2
and so on.
But what I get is, the previous filter is removed before the next
filter is applied.How to solve this??
Perhaps somebody out there would like to help.

Regards,

A Filter clause is a valid SQL WHERE clause, without the word WHERE. You'll
need to construct such a string, using AND or OR logic as appropriate; it can
include many terms, but it's just one filter, not many.

You don't indicate what rs1 and rs2 and so on contain, so it's not clear to me
how best to concatenate them; could you post an example? What field are you
filtering, and where do these criteria come from?
 

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