Message on Report from iif statement

AndeanWayne

Registered User.
Local time
Today, 08:34
Joined
Jan 21, 2012
Messages
27
I have a report with the following equation to give a status message at the end of the report:
=IIf([RedemptionDate] Is Not Null,"THIS PIN HAS BEEN REDEEMED",IIf([DateAbandoned] Is Not Null,"THIS PIN HAS BEEN ABANDONED",IIf([DateSaleInErrors] Is Not Null,"THIS PIN IS A SALE IN ERRORS",IIf([DateAssigned] Is Not Null,"THIS PIN HAS BEEN ASSIGNED",IIf([DateRecordedDeed] Is Not Null,"THIS PIN HAS A RECORDED DEED")))))
It does a fine job but prints the first status that meets the condition. ie if the Date Abonded is not null it prints "THIS PIN HAS BEEN ABANDONED". But one record may meet several of the conditions. Is there a way to print if a record meets two conditions ie Date Abandoned is not null and Date Assigned is not null?
 
Not sure this would work, but you could try:
IIf([DateAbandoned] Is Not Null AND [DateAssigned] Is Not Null,"TWO CONDITIONS MET",IIf([RedemptionDate] Is Not Null,"THIS PIN HAS BEEN REDEEMED",IIf([DateAbandoned] Is Not Null,"THIS PIN HAS BEEN ABANDONED",IIf([DateSaleInErrors] Is Not Null,"THIS PIN IS A SALE IN ERRORS",IIf([DateAssigned] Is Not Null,"THIS PIN HAS BEEN ASSIGNED",IIf([DateRecordedDeed] Is Not Null,"THIS PIN HAS A RECORDED DEED"))))))
 
The problem is that a property may be both Redeemed and Abandoned but the statement only provides that is is Redeemed. I'm looking for a way that it will identify that it is Redeemed Abandoned. Once it meets one condition is stops.
 
The problem is that a property may be both Redeemed and Abandoned but the statement only provides that is is Redeemed. I'm looking for a way that it will identify that it is Redeemed Abandoned. Once it meets one condition is stops.
In that case perhaps the following would work:

IIf([RedemptionDate] Is Not Null,"THIS PIN HAS BEEN REDEEMED",IIf([DateAbandoned] Is Not Null,"THIS PIN HAS BEEN ABANDONED",IIf([DateSaleInErrors] Is Not Null,"THIS PIN IS A SALE IN ERRORS",IIf([DateAssigned] Is Not Null,"THIS PIN HAS BEEN ASSIGNED",IIf([DateRecordedDeed] Is Not Null,"THIS PIN HAS A RECORDED DEED",IIf([DateAbandoned] Is Not Null AND [DateAssigned] Is Not Null,"TWO CONDITIONS MET"))))))

The only other suggestion I have at the moment would be to change the IIF() to an If Then and put the code in the On Format event of that section.
 

Users who are viewing this thread

Back
Top Bottom