Table.filter problems

Discussion in 'Questions (Windows Mobile)' started by J12345T, Aug 19, 2008.

  1. J12345T

    J12345T Member 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.


  2. Erel

    Erel Administrator Staff Member Licensed User

    You should replace '=' with 'LIKE' if you want to use wildcards.
    Add parenthesis to better control the logic precedence.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice