gojets1721
Registered User.
- Local time
- Yesterday, 20:19
- Joined
- Jun 11, 2019
- Messages
- 430
I'm having trouble coding this filter to work correctly with two filters. It's a search box in a form allowing the user to input a department that they want to filter to.
I want it to filter down to department AND THEN filter those results to the year listed in the combo box. The way I have it coded below does so in a way that the second filter just cancels out the first. Any suggestions on how to recode this?
I want it to filter down to department AND THEN filter those results to the year listed in the combo box. The way I have it coded below does so in a way that the second filter just cancels out the first. Any suggestions on how to recode this?
Code:
Dim S As String
S = InputBox("Enter Department", "Department Search")
If S = "" Then Exit Sub
Me.Filter = "Department LIKE ""*" & S & "*"""
Me.Filter = "YEAR([ComplaintDate])= " & Me.ComboYearSelection
DoCmd.SetOrderBy "[ComplaintDate] ASC"
Me.FilterOn = True