How to enable multiple filters

wvgour

New member
Local time
Today, 16:50
Joined
Apr 17, 2015
Messages
1
Hi there!
I have a form where I have buttons that apply filter to a certain column.
How do I enable multiple filters where I can click more than 1 filter button and it keeps the filters?

First filter button:

Private Sub Command1_Click()

DoCmd.ApplyFilter "Filter1", "[MyQuery]![Checkbox1]=Yes", ""

End Sub

Second filter button:

Private Sub Command2_Click()

DoCmd.ApplyFilter "Filter2", "[MyQuery]![Checkbox2]=Yes", ""

End Sub

Third filter button:

Private Sub Command3_Click()

DoCmd.ApplyFilter "Filter3", "[MyQuery]![Checkbox3]=Yes", ""

End Sub

It works well, but one by one.
How can each next filter be added to previous filters by clicking filter button on a form?
Thanks!
 
You probably need some if statements or case statements.
 
And probably a hidden text box to save the filter string so far as well as a button to clear the filter.
 

Users who are viewing this thread

Back
Top Bottom