I have a continuous form with comboboxes that feed into a query. In addition to the comboboxes, I'd like to add a multi select list box that enables the user to filter the form (query results) based upon the selections.
For reference, the field that I would like to filter on is also referenced in the query code via combobox.
However, each time I attempt to requery, I get a syntax error (missing operator) on the Criteria.
the name of the multi select list box is "status_list", and the field that I am looking to filter on is "status_cd" (this is the name of the textbox and control within the form).
hope I gave enough detail, so if anyone needs more, let me know.
thanks!
the code I have is:
Dim Criteria As String
Dim i As Variant
Criteria = ""
For Each i In Me![Status_List].ItemsSelected
Criteria = Criteria & "," & Me![Status_List].ItemData(i)
Next i
Criteria = Mid(Criteria, 2)
Criteria = "Where status_cd In(" & Criteria & ")"
Me.Filter = Criteria
Me.FilterOn = True
Me.Requery
Me.Refresh
For reference, the field that I would like to filter on is also referenced in the query code via combobox.
However, each time I attempt to requery, I get a syntax error (missing operator) on the Criteria.
the name of the multi select list box is "status_list", and the field that I am looking to filter on is "status_cd" (this is the name of the textbox and control within the form).
hope I gave enough detail, so if anyone needs more, let me know.
thanks!
the code I have is:
Dim Criteria As String
Dim i As Variant
Criteria = ""
For Each i In Me![Status_List].ItemsSelected
Criteria = Criteria & "," & Me![Status_List].ItemData(i)
Next i
Criteria = Mid(Criteria, 2)
Criteria = "Where status_cd In(" & Criteria & ")"
Me.Filter = Criteria
Me.FilterOn = True
Me.Requery
Me.Refresh