Results 1 to 6 of 6
  1. #1
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    IF THEN statement in a Report (Access 2000)

    Let's say that I have a report and one of the fields is "Transport". I want to put another field (text box) in the report that will display CAR only if the value of Transport = CompanyCar. Otherwise I want it to be blank.

    I assume that you can enter an if then statement in that text box, but I can't figure out how to do it.

    If anyone out there has any ideas, I'd me most grateful.

    Thanks,

    JoeK

  2. #2
    2 Star Lounger
    Join Date
    May 2002
    Location
    Jerusalem, Israel
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: IF THEN statement in a Report (Access 2000)

    Thanks, I got it to work. by putting the field <transport> before the second = in the statement.

    Appreciate your help.

    JoeK

  3. #3
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: IF THEN statement in a Report (Access 2000)

    That's strange, I don't know how that got lost. I know I had it in there, because I had originally typed Transport="CompanyCar" and then I changed it to <transport>="CompanyCar".
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

  4. #4
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: IF THEN statement in a Report (Access 2000)

    Ah, apparently using the word Transport enclosed in brackets is translated as some sort of display command, so the phrase is not displayed.
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: IF THEN statement in a Report (Access 2000)

    Any tag beginning with <!t>[Tr is interpreted as the "table row" tag. You can get around it by using the <!t>[t]<!/t> tag instead of [ : <!t>[t]<!/t>Transport<!t>[/t]<!/t> becomes <!t>[Transport]<!/t>.

  6. #6
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: IF THEN statement in a Report (Access 2000)

    Edited by HansV to use "tag" tags

    The ControlSource of the new textbox should be:

    =IIF(<!t>[Transport] = "CompanyCar","Car",Null)
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

Posting Permissions

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