IIF statement argument not specified error

  • Hi,

    Can anyone help solve my IIF statement problem?

    Originally the statement was as below in Fig1 and functioned correctly, but when i remove the "First" field I receive an argument not specified error.

    This is probably quite simple for someone to resolve but i am struggling to see where i am going wrong.

    Fig1

    =IIf(First(Fields!Customer_Name.Value, "MainDS") Is Nothing, "", First(Fields!Customer_Name.Value, "MainDS") + chr(13) + chr(10)) +

    IIf(First(Fields!AddressLine1.Value, "MainDS") Is Nothing, "", First(Fields!AddressLine1.Value, "MainDS") + chr(13) + chr(10)) +

    IIf(First(Fields!AddressLine2.Value, "MainDS") Is Nothing, "", First(Fields!AddressLine2.Value, "MainDS") + chr(13) + chr(10)) +

    IIf(First(Fields!AddressLine3.Value, "MainDS") Is Nothing, "", First(Fields!AddressLine3.Value, "MainDS") + chr(13) + chr(10)) +

    IIf(First(Fields!AddressLine4.Value, "MainDS") Is Nothing, "", First(Fields!AddressLine4.Value, "MainDS") + chr(13) + chr(10)) +

    IIf(First(Fields!AddressLine5.Value, "MainDS") Is Nothing, "", First(Fields!AddressLine5.Value, "MainDS") + chr(13))

    Fig2

    =IIf (Fields!Customer_Name.Value) Is Nothing, "", (Fields!Customer_Name.Value, "MainDS") + chr(13) + chr(10)) +

    IIf (Fields!AddressLine1.Value, "MainDS") Is Nothing, "", (Fields!AddressLine1.Value, "MainDS") + chr(13) + chr(10)) +

    IIf (Fields!AddressLine2.Value, "MainDS") Is Nothing, "", (Fields!AddressLine2.Value, "MainDS") + chr(13) + chr(10)) +

    IIf (Fields!AddressLine3.Value, "MainDS") Is Nothing, "", (Fields!AddressLine3.Value, "MainDS") + chr(13) + chr(10)) +

    IIf (Fields!AddressLine4.Value, "MainDS") Is Nothing, "", (Fields!AddressLine4.Value, "MainDS") + chr(13) + chr(10)) +

    IIf (Fields!AddressLine5.Value, "MainDS") Is Nothing, "", (Fields!AddressLine5.Value, "MainDS") + chr(13) + chr(10)) +

    IIf (Fields!Postcode.Value, "MainDS") Is Nothing, "", (Fields!Postcode.Value, "MainDS")

  • The first line in fig 2 should be

    =IIf(Fields!Customer_Name.Value Is Nothing, "", Fields!Customer_Name.Value) + chr(13) + chr(10)) +

    Why are you removing First for CustomerName but using for Address?

    Far away is close at hand in the images of elsewhere.
    Anon.

  • Thank you, my brackets were incorrect.

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

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