Access Query SQL IIf Statement with OR
<p>I have the following SQL statement:</p>

<pre><code>SELECT * FROM BOM INNER JOIN Parts ON BOM.PartID = Parts.PartID
WHERE (((BOM.PUMP_CODE) Like (IIf([Forms]![frmSelector]![tbMotor]&gt;0 And
     [Forms]![frmSelector]![tbShaft]&gt;0,"MOTOR" Or "SHAFT",IIf([Forms]![frmSelector]![tbMotor]&gt;0,"MOTOR","SHAFT")))))
ORDER BY BOM.BOM_INDEX;
</code></pre>

<p>In the first IIF statement, I cannot get the query to return any records. I want it to return all records with either "MOTOR" or "SHAFT" in the PUMP_CODE field when both referenced objects are > 0. Even though both objects are greater than 0, it still does not return any records. The latter IIF statement is working just fine however. Is there a problem with this query?</p>