I have been trying to adapt a method to filter a sub form on a tab page in my master form with a combo box that is also on the tab page (not the main form).
The subform lists all records for the field linking the subform to the master form but I want to filter these further by Species and Year;
Private Sub ComboFilterSpp_AfterUpdate()
Dim strwhere As String
If IsNull(Me.ComboFilterSpp) = False Then strwhere = "(Species = " &
Me.ComboFilterSpp & "')"
End If
If IsNull(Me.ComboFilterYear) = False Then
If strwhere < "" Then
strwhere = strwhere & " and "
End If
strwhere = "(Year = '" & Me.ComboFilterYear & "')"
End If
strwhere = "select * from Survey_Report_Query where " & strwhere
Me.Survey_Report_Query_SF.Form.RecordSource = strwhere
End Sub
My combo boxes are ComboFilterSpp and ComboFilterYear, my sub form is
Survey_Report_Query_SF and my underlying query is Survey_Report_Query.
For some reason I am getting a compile error "Method or data member not
found" when I call the subform.
I suspect I may also be having numerical data issues since the field I am filtering by has an underlying numerical value.
I would be greatly appreciative of any help you might give.