where do you declare Dim strWhere as string?
I would write it as a separate procedure. Something like (aircode)
Code:
Private Sub MyFilter()
Dim strFilter As String
If Not IsNull(Me.SCategory) Then
strFilter = strFilter & " And " & "SOP_Category =""" & Me.SCategory & """"
End If
If Not IsNull(Me.GenerateDate) Then
strFilter = strFilter & " And " & "Generated = #" & Me.GenerateDate & "#"
End If
strFilter = Mid(strFilter, 5)
debug.print strFilter
If nz(strFilter,"")<>"" then
Me.Filter = strFilter
Me.FilterOn = True
end if
End Sub
Then you can call it in the afterupdate of both combos
If this helped, please click the star * at the bottom left and add to my reputation- Thanks