Solved

Cant clear Filter property in ADO Recordset

Posted on 2002-03-10
3
2,334 Views
Last Modified: 2012-06-21
Hi,

I encountered a strange thing in my app and hoped somebody could help me out.

I have a single data environment with one connection contianing two record sets. One of these recordsets is bound to a data grid.

Now, in reponse to a search I set the filter of this recordset, like so: rsTable.Filter = "Field = 'value'" Now this works fine, the right subset of records are displayed.

Then, we want to clear the search. I.e. no filter. Here is the problem. I cannot get the filter property to clear. Setting it to the "" results in no records being displayed. I also tried:

rsTable.Filter = vbNull

in hopes of setting it to a null string, i.e. no string as opposed to the empty string. This time the record set did not change, the same set of records continued to be displayed.

What would be the correct way to clear the Filter property in the ADO recordset after it has been set previously?

Many thankx in advance,
Pavarotti26
0
Comment
Question by:pavarotti26
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 6854931
try
rsTable.Filter = adFilterNone
0
 

Author Comment

by:pavarotti26
ID: 6854969
Hi,

Okay great, thats good.

Stange tho, cos it still wouldn't show any records. Eventually discovered that I must put something in the Sort property, then the grid was populated, otherwise it remained empty?

Any ideas why? Strange if you ask me!

Anycase, thanks for the filter tip.


0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6854972
update your ADO version. you seems to have an old version.
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

717 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question