borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (problem with MSDE2000 and SQL 2003)Next Topic (Import data from Excel to Access Database through VB Code) New Topic New Poll Post Reply
AndreaVB Forum : Database : master, how can i disable my filter?
Poster Message
blacklisted
Level: Protégé

Registered: 08-09-2006
Posts: 8

icon master, how can i disable my filter?

hey,

how can i deactivate my filter in the datagrid?
how can i change it back to see all data?

thanks again!

[Edited by blacklisted on 01-10-2006 at 11:08 AM GMT]

01-10-2006 at 11:07 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: master, how can i disable my filter?

By setting the datagrid's recordset filter on an empty string, with
   DataGrid1.Filter = ""
or
    Adodc1.Recordset.Filter = ""

Hope it helps.


[Edited by yronium on 01-10-2006 at 04:01 PM GMT]

____________________________
Real Programmer can count up to 1024 on his fingers

01-10-2006 at 02:59 PM
View Profile Send Email to User Show All Posts | Quote Reply
blacklisted
Level: Protégé

Registered: 08-09-2006
Posts: 8
icon Re: master, how can i disable my filter?

hi,
the code doesnt work. my datagrid displays empty data.

01-10-2006 at 03:22 PM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: master, how can i disable my filter?

What code are you using to set the filter on? If you have set the Filter property of whatever to an SQL criteria, you have to set the same Filter property to an empty string in order to remove the filter. This method works either if you linked the datagrid on a recordset, or if you linked it on an ADODC control, or else: wherever you have set before the Filter property you have to put an empty string, with something like:
    (...whatever you used...).Filter = "".

Hope it helps, otherwise, post the code you use to link the datagrid.

[Edited by yronium on 01-10-2006 at 06:36 PM GMT]

____________________________
Real Programmer can count up to 1024 on his fingers

01-10-2006 at 05:35 PM
View Profile Send Email to User Show All Posts | Quote Reply
blacklisted
Level: Protégé

Registered: 08-09-2006
Posts: 8
icon Re: master, how can i disable my filter?

here is what i did

Adodc2.Recordset.Filter = "title like '" & Combo2.Text & "*'"


the datagrid is connected to adodc

i put the
Adodc2.Recordset.Filter = ""
code to a command button so if i click it it will show again all the data.

is there something wrong with my coding?

02-10-2006 at 01:31 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: master, how can i disable my filter?

quote:
is there something wrong with my coding?
It should not. Have a look in the help for the Filter property, and I'll try finding a moment for some test in the while.

____________________________
Real Programmer can count up to 1024 on his fingers
02-10-2006 at 08:00 AM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 907
icon Re: master, how can i disable my filter?

OK, try one of the following two:
    ' (the next two lines would mean the same)
    Adodc2.Recordset.Filter = adFilterNone
    Adodc2.Recordset.Filter = 0

And let me know.

____________________________
Real Programmer can count up to 1024 on his fingers

02-10-2006 at 04:26 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : master, how can i disable my filter?
Previous Topic (problem with MSDE2000 and SQL 2003)Next Topic (Import data from Excel to Access Database through VB Code) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder