Query criteria

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?
 
E

Ed Robichaud

Oops! Meant to say that option6 returns no records (and there are some for
that criteria).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Use Or in function 5
Strange Query Results 3
Crosstab query help 1
Pie charts / underlying query 0
Syntax error when using Nz in query 1
Criteria 1
no criteria 3
Customizing query/report 1

Top