Boolean Iif... And allowed??

  • I'm creating a variable with the following expression:

    =Iif( Fields!Dir_Mgr.Value = " " AND

    Fields!Department.Value = "Health Advisors",

    "Gail Harries", Fields!Dir_Mgr.Value)

    However, I'm getting error msg:

    The value expression for the field ‘=Iif( Fields!Dir_Mgr.Value = " " AND

    Fields!Department.Value = "Health Advisors",

    "Gail Harries", Fields!Dir_Mgr.Value)’ contains an error: [BC30455] Argument not specified for parameter 'TruePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.

    I thought the syntax was correct. Or is it because IIF and AND?

    thx,

    john

  • the syntax posted is correct. is that the verbatim expression? try replacing the Iif parameters with literals until you find the real culprit.

    =Iif( True AND False, "a", "b") ' evaluates to b

    =Iif( Fields!Dir_Mgr.Value = " " AND False, "a", "b")

    =Iif( Fields!Dir_Mgr.Value = " " AND Fields!Department.Value = "Health Advisors", "a", "b")

    =Iif( Fields!Dir_Mgr.Value = " " AND Fields!Department.Value = "Health Advisors", "Gail Harries", "b")

  • Ok, thx.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply