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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"0" Not printing on report

Status
Not open for further replies.

xicana

Technical User
Dec 11, 2003
100
US
I have a text box that uses some functions to perform a calculation, one of them being a switch function. if the calculation renders a "0" it does not display it on the report - just a blank space.

I'm thinking this has something to do with the properties of the text box...any ideas?
Code:
=Switch([calculation]<0,0,[calculation]>0,[calculation])

I've tried inclosing the 0 in single and double quotes...still doesn't work.

Thanx!

Sandy
 
Try
Code:
=Switch([calculation]<0,0,[calculation]>=0,[calculation])
or
Code:
=IIf([calculation]<0,0,[calculation])

Duane
MS Access MVP
Find out how to get great answers faq219-2884.
 
I tried your solutions and it worked for some calculations but not all - i went back to the table and noticed that some of the records would not have data in the fields I was referring to.

In a text box can I do something like this:

if [calculation] is null then
txtBox = 0
else
txtBox = [calculation]

Thanks for your suggestions Duane.
[gorgeous]

Sandy
 
Code:
=IIf(Nz([calculation],0)<0,0,Nz([calculation],0))

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