Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2002
    Location
    Seattle
    Posts
    10

    Question Unanswered: If then statement as a report control

    Does anyone happen to know how to, or even if it is possible, to put an "If...Then" statement as the criteria for a control in a report?
    I don't know if that makes sense, so here is what I'm trying to acomplish:
    I have a report that will display a person's last name, first name and middle name along with a full address and two phone numbers.
    What I want is that if someone selects a checkbox marked SUV (in the form this report is based on), then I want the report to use this set of data. If the box is unchecked I want it to use another set of data.

    What I tried doing was putting this expression as the control:
    [If [SUV] = True Then [Last Name] & ", " & [First Name] & " " & [Middle Name] Else [Last NameS] & ", " & [First NameS] & " " & [Middle Name]

    It then returns an error message of, "Missing Operator..."
    Does anybody know what the heck I need to do, need to fix, or need to kick to get this to work the way I want it to? Any help is GREATLY appreciated.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    what you need is the "immediate if" which goes like this

    iif(expressionWhichEvaluatesTrueOrFalse, ThisWhenTrue, ThisWhenFalse)

    and of course you can stack them.....

    iif(SolidBool, iif(SweetBool, "Chocolate", "Bread"), iif(PrefsBool, "Wine", "Beer"))

    izy

Posting Permissions

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