PC Review


Reply
Thread Tools Rate Thread

applying concatenate filter

 
 
eRDe
Guest
Posts: n/a
 
      5th Jun 2010
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,

 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      5th Jun 2010
On Sat, 5 Jun 2010 08:41:46 -0700, eRDe <(E-Mail Removed)>
wrote:

>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?
--

John W. Vinson [MVP]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter keeps re-applying itself Brutuswa Microsoft Outlook BCM 0 22nd Jan 2010 08:21 AM
Applying more than 1 filter lecoughlin@gmail.com Microsoft Access 4 8th Jun 2007 11:09 PM
Applying Filter Timo Microsoft ADO .NET 5 30th Jun 2005 07:07 PM
Applying a filter John Martin Microsoft Access Getting Started 2 20th Jan 2005 01:18 AM
applying a filter? Tom McDonnell Microsoft Access VBA Modules 0 7th Aug 2003 07:01 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:52 PM.