Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IIF Statement in Report

Status
Not open for further replies.

mauricionava

Programmer
Jul 8, 2005
209
US
Hello, I have a report that in the query behind it I have a field for status. One of the status is "C". The Status field is not shown in the report. What I want is that in a text field in the report I put an IIF statement that will show an X when the status is "C" and black when there's any other status. Just an X when the status is "C". Is that possible to do?

Thanks in advance
 
Perhaps:

[tt]=IIf([Status]="C","X","")[/tt]

 
Just put
Code:
=iif([qryfield]="C", "X", "")
in the control source for the text box.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
I would promote returning Null in IIf()s if you really don't want to return a value:
=IIf([Status]="C","X",Null)

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top