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 strongm 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 a report 1

Status
Not open for further replies.

Tiggertoo

MIS
May 28, 2003
66
US
In my report this is my control source. What I'm trying to get is if there is information in the field "content10" then the information is returned; if the field is blank then it returns "none." I'm getting "Error". What have I done wrong.

=IIf(IsNull([content10]),"none ",[content10])
 
Your first post is correct (it should be IsNull(field) not the other way), but I'm thinking they aren't null values you're getting...probably zero-length strings. Try this:

=IIf([content10]="","none",[content10])

Hope that helps.

Kevin
 
Try:
=Nz([content10]),"none")

Duane
MS Access MVP
 
Make sure you don't have a textbox (or any other control) named content10.

Jennifer
 
I continued to get error messages so I ended up using
c10: IIf(IsNull([Content10]),"No comments.",[content10])
in my query. Then on the report my control source became "c10". Thanks for everyone's help anyway.
 
I'm trying get a simple expression in the Access report writer to work properly. Essentially if I use:

=IIf([COMPLETION_CODE]="1","Conducted","Cancelled")

I get an error. Yet, if I run the following:

=IIf([COMPLETION_CODE],"Conducted","Cancelled")

I actually get the word "Conducted" to print. However, this is nonsense. Anyone have a clue as to why this is acting so odd?

OracleVictim
 
COMPLETION_CODE must be numeric. You shouldn't compare it to the string "1". If COMPLETION_CODE is a numeric value other than 0, your expression would always return Conducted.

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top