Table.filter problems


Licensed User
Hi All,

I'm having problems adding multiple filters to a table. The filter uses variables which can be user defined during runtime via menu items on the main form. Each variable returns the correct value before the table.filter expression is run so no problem there. The runtime produces no syntax errors so again no problem there. The filter just doesn't 'filter'.

Eg TableOut.Filter("Flt2 = '" & legs & "' and " & dayout & " <> '' ")

ie. Return the rows in column Flt2 that contain the string 'legs'. Legs is user selectable to either 'direct' or '*' (wildcard); and return the rows under column dayout which contain something; dayout is a predefined day of the week variable.

When run, the filter expression works OK with 'direct' but returns nothing with '*' wildcard. Also, the full expression actually looks like this:-

TableOut.Filter("Flt2 = '" & legs & "' and " & dayout & " <> '' or Ax='" & Airlinenz & "'or Ax='" & Airlineek & "'or Ax='" & Airlineqf & "'or Ax='" & Airlinejq & "'or Ax='" & Airlinedj & "'")

...a mouth full I know... It seems that as soon as I add more than a couple of filter terms none of the filter terms work yet if you reduce back to just one term sometimes it works and other times it does not. It's very confusing so if there is an easier way I'm all ears.