The way I manage multiple filters is to build the query SQL up in sections using strings, checking each part works then adding the next
The overall SQL might be:
Code:
strSQL = strSelect & strFrom & strWhere & strGroupBy & strOrderBy
It should hopefully be obvious what each part of the SQL string refers to.
The filter part in strWhere might itself be made up of several parts
Code:
strWhere = " WHERE (" & strDateFilter & strIncidentTypeFilter & strYearFilter & strLocationFilter & strTimeFilter & ")"
Individual filters would be like this:
Code:
strDateFilter = "([Incident Date] Between #" & Format(Me.txtFrom, "mm/dd/yyyy") & _
"# And #" & Format(Me.txtTo, "mm/dd/yyyy") & "#) "
strIncidentTypeFilter = " And [Incident Type] = '" & Me.cboIncidentType.Column(1) & "'"
strLocationFilter = " And Location = '" & Me.cboLocation.Column(1) & "'"
etc...
So in the example below these combine to give
Code:
strWhere = " WHERE (([Incident Date] Between #01/21/2016# And #01/08/2018#) And [Incident Type] = 'TAWG' And Location = 'Cockfosters')"
In this case the output is a chart but the idea applies equally to a list of filtered records
Hope that helps rather than confuses you ...