SQL With a IIF and a LIKE

  • Thread starter Thread starter ZigZagZak
  • Start date Start date
Z

ZigZagZak

I have a combo box that I based on a query. Access is saying the query is to
complex. I am obviously not doing it right.....help???

SELECT MATERIAL.SIZE
FROM MATERIAL
WHERE (((MATERIAL.[MATERIAL TYPE])=IIf([Forms]![SUGGEST DROPS]![MATERIAL]
Like "*" & "BAR" & "*",([MATERIAL].[MATERIAL TYPE])<>"304SS PLATE" And
([MATERIAL].[MATERIAL TYPE])<>"1040MOD" And ([MATERIAL].[MATERIAL
TYPE])<>"A36",([MATERIAL].[MATERIAL TYPE])<>"304SS BAR" And
([MATERIAL].[MATERIAL TYPE])<>"303SS BAR" And ([MATERIAL].[MATERIAL
TYPE])<>"RED BAR" And ([MATERIAL].[MATERIAL TYPE])<>"BLACK BAR" And
([MATERIAL].[MATERIAL TYPE])<>"YELLOW BAR")))
ORDER BY MATERIAL.SIZEDEC;
 
nevermind.........figured it out..............sometimes its because you make
it harder than it was supposed to be.......arg......
 
Hi,

Try replacing all those ANDs with an in statement.....

[Material Type] not in("304SS PLAtE", "1040MOD","A36","304SS BAR")

Etc....

HTH
Rob
 
Back
Top