Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2013

    Unanswered: Form Filter with multiple criteria

    Hi all,

    I've been trying to get this simple form filter to work without luck for days now. I'm trying to filter for anything BUT id 3, 7, or 13.

    Either through the form property sheet or vba, and nothing seems to work.

    [ItemTypeID] <> 3 Or [ItemTypeID] <> 7 " Or [ItemTypeID] <> 13
    I can get any part of it to work, (either 3 or 7 or 13), but not all three and not with the <>.

    Any ideas?

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    should be an AND not an OR between each element. effectively you have coded it as 3 standalone elements, so by deifnition all rows will be returned becuase if the itemtype was 3 it would still be returned as 3 isn't 7 or 13
    ([ItemTypeID] <> 3 AND [ItemTypeID] <> 7 " AND [ItemTypeID] <> 13)
    but it can also be expressed as
     [ItemTypeID] NOT in (3,7,13)
    SQL: IN Function

    bear in mind a where clause evaluates to a boolena yes/no value. so if the source row meets the boolean test it will be returned
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Dec 2013
    Thank you x2.

    The AND did the trick, but even more, the IN function is new to me. I like that a little better, seems neater.

    Thanks for the link.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts