Clear only one filter

VaYooper

New member
Local time
Today, 05:41
Joined
Mar 16, 2015
Messages
8
I've seen code similar to below that clears all filters, but is it possible that instead of clearing all filters, I can clear just a specific one?


Private Sub cbGroup_Click()
Me.cboUnitName = Null
Me.cboGroup = Null
Me.tbl_users_subform.Form.Filter = ""
Me.tbl_users_subform.Form.FilterOn = False
Me.tbl_users_subform.Form.RecordSource = "tbl_users"
Me.tbl_users_subform.Requery
End Sub
 
Your question might need a little bit more details.
 
For example.. on my form I have around six combo boxes and a checkbox. On the side I have a clear button that resets the filters in all the combo boxes. I did this with this code:

Private Sub Command36_Click()
Me.cboUserType = Null
Me.cboSSAAR = Null
Me.cboLastName = Null
Me.cboLastLogin = Null
Me.cboUnitName = Null
Me.cboGroup = Null
Me.cbGroup = Null
Me.tbl_users_subform.Form.Filter = ""
Me.tbl_users_subform.Form.FilterOn = False
Me.tbl_users_subform.Form.RecordSource = "tbl_users"
Me.tbl_users_subform.Requery
End Sub


I would also like it if when I click on a checkbox it would only clear the filters on Me.cboUnitName and Me.cboGroup combo boxes instead of all combo boxes. I tried using the Click() script above but it still reset all the combo boxes.
 

Users who are viewing this thread

Back
Top Bottom