Reseting Filter

  • Thread starter Thread starter PJ
  • Start date Start date
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.
 
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
 
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
 
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
 
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
 
Back
Top