Query criteria

  • Thread starter Thread starter Ed Robichaud
  • Start date Start date
E

Ed Robichaud

I have a filter-by-form query who's WHERE clause is not working as I
expected.

IIf([Forms]![frmLWFilter]![pickOrigin] Is
Null,"*",IIf([Forms]![frmLWFilter]![pickOrigin]=10,'Value1',IIf([Forms]![frmLWFilter]![pickOrigin]=9,'Value2',IIf([Forms]![frmLWFilter]![pickOrigin]=6,([tblFamilies].[City])<>"Value1"
and <>"Value2"))))

I intended that a blank selection would return all records, option10 return
records with value1, option9 return records with value2 and option6 returns
records NOT value1 nor value2.

All the above works OK, except the option6 choice; it returns no blank
records. Apparently the "not equal to" operator is not allowed here. Any
suggestions to restating the criteria to get the desired results?
 
Oops! Meant to say that option6 returns no records (and there are some for
that criteria).
 
Back
Top