Reseting Filter

P

PJ

Hi All,
I have form running on a query with a few filtering combo boxes.

I have the following code in the query for the criteria:
Like "*" & Forms!frmMain!cboCombo1 & "*"

in the afterupdate of each combo i have me.requery

in the Clear Filter button I have the following:
cbocombo1.value = ""
cbocombo2.value = ""
me.filter = false

although the text boxes clear but the filter is still on. is there a way to
fix this? Thanks.
 
S

Stuart McCall

PJ said:
Hi All,
I have form running on a query with a few filtering combo boxes.

I have the following code in the query for the criteria:
Like "*" & Forms!frmMain!cboCombo1 & "*"

in the afterupdate of each combo i have me.requery

in the Clear Filter button I have the following:
cbocombo1.value = ""
cbocombo2.value = ""
me.filter = false

although the text boxes clear but the filter is still on. is there a way
to
fix this? Thanks.

Try Me.FilterOn = False
 
P

PJ

Thanks Stuart, but it's not working either.

I have the filters in the footer of the form, so i tried
forms!frmMain.filteron = false but that's not working either
 
B

Bob Quintal

Hi All,
I have form running on a query with a few filtering combo boxes.

I have the following code in the query for the criteria:
Like "*" & Forms!frmMain!cboCombo1 & "*"

in the afterupdate of each combo i have me.requery

in the Clear Filter button I have the following:
cbocombo1.value = ""
cbocombo2.value = ""
me.filter = false

although the text boxes clear but the filter is still on. is
there a way to fix this? Thanks.
setting the filter in a query is not the same as setting a filter in
a form. the two are independent. That's why you are having your
problems.

Change the me.filter = false to me.requery
 
P

PJ

Thanks Bob,
Works perfectly
Bob Quintal said:
setting the filter in a query is not the same as setting a filter in
a form. the two are independent. That's why you are having your
problems.

Change the me.filter = false to me.requery
 

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