var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Filtering a subform with a combo box
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 & "')"
If IsNull(Me.ComboFilterYear) = False Then
If strwhere < "" Then
strwhere = strwhere & " and "
strwhere = "(Year = '" & Me.ComboFilterYear & "')"
strwhere = "select * from Survey_Report_Query where " & strwhere
Me.Survey_Report_Query_SF.Form.RecordSource = strwhere
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.
IsNull(Me.ComboFilterSpp) = False
is incorrect syntax; should be:
either it is or is not - no true or false
Tags for this Thread