Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Feb 2001
    Location
    Escondido, California, USA
    Posts
    1,458
    Thanks
    0
    Thanked 1 Time in 1 Post

    IIF Syntax (2003 / 2000)

    Can you advise what is wrong with this expression that I'm trying to use on a report?

    =IIf([ShipToSame],[BillingAddress],[ShipToAddress])

    ShipToSame is a logical field (yes/no). The other two are fields in the query that the report is based on.

    The idea is that if ShipToSame is true, then display the billing address, else display the ship to address.

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: IIF Syntax (2003 / 2000)

    Try this.

    =IIf([ShipToSame]=true,[BillingAddress],[ShipToAddress])
    Regards
    John



  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: IIF Syntax (2003 / 2000)

    Both your and John Hutchison's expressions should work. What exactly is the problem? Do you get an error, or nothing, or an unexpected result?

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: IIF Syntax (2003 / 2000)

    Access 2003 complains about syntax like that if the Control on the Report has the same name as one of underlying fields in the calculation. Try adding a txt to the front of the control name.
    Regards
    John



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •