Does not equal filter using vba-access <p>Hello everyone I have been trying to filter data for the "First Match" and "Second Match" that does not equal certain values so the best way I thought of doing this was to create an array of possible values for the field that you would want to filter out and then use a for loop to go through each possible value and filter the data accordingly and at the same time append the values so the previous filtered data will not be lost.</p> <pre><code>Private Sub notEqual_Click() Dim strArray(0 To 13) As String strArray(0) = 0 strArray(1) = 2 strArray(2) = 3 strArray(3) = 4 strArray(4) = 5 strArray(5) = 6 strArray(6) = 7 strArray(7) = 8 strArray(8) = 9 strArray(9) = 10 strArray(10) = 11 strArray(11) = 12 strArray(12) = 13 strArray(13) = 14 For i = LBound(strArray) To UBound(strArray) 'txtF and txtL refers to the text box value If txtF &lt;&gt; "15" And txtF &lt;&gt; "1" Then Me.Filter = "[First Match] = " &amp; strArray(i) Me.Filter = Me.Filter &amp; strArray(i) End If If txtL &lt;&gt; "15" And txtL &lt;&gt; "1" Then Me.Filter = "[Second Match] = " &amp; strArray(i) Me.Filter = Me.Filter &amp; strArray(i) End If Next Me.FilterOn = True End Sub </code></pre> <p>I get an error that says syntax error (missing operator) in query expression 'First Match0". Am I possibly appending the values the wrong way? I feel like there is something wrong with the code inside the for loop.</p>