I have a tab page with a data sheet subform that lists all the records for the linked field in the master form. I am trying to set up two simple filters on the tab page with unbound combo boxes using this approach:
Private Sub ComboFilterSpp_AfterUpdate()
If IsNull(Me.ComboFilterSpp) Then
Me.FilterOn = False
Else
Me.Survey_Report_Query_SF.Form.Filter = "[Species] = " & Me.ComboFilterSpp
Me.FilterOn = True
End If
End Sub
My Combo Boxes are ComboFilterSpp and ComboFilterYear and my Sub Form is Survey_Report_Query_SF. The field I am trying to filter is a numerical field.
I would like to keep the option of unfiltered records if the combo boxes are NULL. It seems this is a straightforward goal but I keep getting compile error messages such as "Method or data member not found".
Any help would be greatly appreciated.
Private Sub ComboFilterSpp_AfterUpdate()
If IsNull(Me.ComboFilterSpp) Then
Me.FilterOn = False
Else
Me.Survey_Report_Query_SF.Form.Filter = "[Species] = " & Me.ComboFilterSpp
Me.FilterOn = True
End If
End Sub
My Combo Boxes are ComboFilterSpp and ComboFilterYear and my Sub Form is Survey_Report_Query_SF. The field I am trying to filter is a numerical field.
I would like to keep the option of unfiltered records if the combo boxes are NULL. It seems this is a straightforward goal but I keep getting compile error messages such as "Method or data member not found".
Any help would be greatly appreciated.