Your strWhere variable is already delimited with quotes, so delimiting it again in the Filter criteria may be causing your problem. Try
Me.Filter = "[Category]=" & strWhere -- _________
Sean Bailey
"Mark Kubicki" wrote:
[Quoted Text] > I have the following code set up to filter a form, but the results are > always blank... > > any suggestions on what might be going on? > > lsFilter is a listbox with a simple mulit select > the values are a string > the field [Catagory] is in the data source for the form and is also a string > > strDelim = """" > With Me.lstFilter > For Each varItem In .ItemsSelected > If Not IsNull(varItem) Then > strWhere = strWhere & strDelim & LTrim(.ItemData(varItem)) & > strDelim & " or " 'build the filter criteria > End If > Next > strWhere = Left(strWhere, Len(strWhere) - 4) ' clean up the trailing > "or" > End With > > Me.Filter = "[Catagory] = '" & strWhere & "'" > Me.FilterOn = True > > as always, thanks in advance, > mark > > > >
|