Syntax for function arguments RRS feed

  • Question

  • the following function call works as is but it seems a waste of time to execute 2 'IIF()'s .

    X: fcnAA(IIf(TestTrue,"fldAName","fldBName"),IIf(TestTrue,[fldAVal],[fldBVal]))

    Is there a way to accomplish this with just one IIF() so that what ends up being 2 arguments in the function call is like below:

    X: fcnSAA("fldAName”, fldAVal)      OR      X: fcnAA("fldBName”, fldBVal)   

    And what is passed to the function is:   “UnitID”,34    or      “EmployeeID”, 4758

    It is probably just a syntax issue but I can't figure it out.

    Thursday, June 2, 2016 7:41 PM


  • Hi. I think it's a six of one and half a dozen of the other scenario. If I rewrite it with just one IIf(), it might look something like this:

    X: IIf(TestTrue, fcnAA("fldAName",fldAVal), fcnAA("fldBName",fldBVal))


    Thursday, June 2, 2016 7:48 PM