title: Wrong Number of Arguments Used With Function in Query Expression
body: <p>I have an SQL in Access 2010 that was written by someone else that gives a Wrong Number of Arguments error when I try and run it. It's supposed to filter a report from a search page.</p>
  
  <pre><code>    SELECT Activity.[ProjNo], Activity.[Code], Activity.[Type], Activity.[ProjNoStatus], 
             Activity.[Preliminary], Activity.[Planner], Activity.[Designer],  
             Activity.[Officer], Activity.[Manager], Activity.[Staff], Activity.[Analyst], 
             Activity.[Manager], Activity.[DeptHead], Activity.[ContractNumber], 
             Activity.[InfoOfficer],Activity.[ProjNoDesigner]
      FROM Activity
      WHERE Activity.ProjNo=Index.ProjNo AND (((IIf([Forms]![SearchForm]![txtCode]="",
            "*",[Activity].[Code]=[Forms]![SearchForm]![txtCode]))&lt;&gt;False) 
            AND ((IIf([Forms]![SearchForm]![txtType]="","*",[Activity].[ Type]="", 
            "*", [Activity].[Type]=[Forms]![SearchForm]![txtType]))&lt;&gt;False) AND 
            ((IIf([Forms]![SearchForm]![txtProjNoStatus]="","*",
            [Activity].[ProjNoStatus]&lt;=[Forms]![SearchForm]![txtProjNoStatus]))&lt;&gt;False));
  </code></pre>
  
  <p>I'm not very experienced with SQL and, like I said, I didn't write this code (the person who did has long since retired) so any help would be great.</p>