replacing a Null value with zero for a control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a report based on a cross tab query that works fine. I have a number
of "cells" with no value and for visual reasons would like to fill those with
a zero. Initially the text box control was bound to a field in the query,
and I got either a value or a blank. I tried to change the control source of
the text box to =IIf([ControlName] Is Null, 0, fieldname), but I get an
error. Any suggestions?
 
Use Nz («expr», «valueifnull»)
It should look something like this Nz([ControlName], 0)
Good Luck
 
Also, I think the reason you are getting an error is that IsNull is a
function so your statement should look like

=IIf(IsNull[ControlName], 0, fieldname)

Luck
 
Thanks for the help. I initially used your suggestion below, but it still
didn't solve the problem. The text box was originally set up as a bound
control and changing the text box control source to the code below didn't
work. But I then deleted the bound control and created a new unbound control
and added your suggested code as the control source and it worked. Thanks
again.

GH said:
Also, I think the reason you are getting an error is that IsNull is a
function so your statement should look like

=IIf(IsNull[ControlName], 0, fieldname)

Luck

Jim Coughlin said:
I have a report based on a cross tab query that works fine. I have a number
of "cells" with no value and for visual reasons would like to fill those
with
a zero. Initially the text box control was bound to a field in the query,
and I got either a value or a blank. I tried to change the control source
of
the text box to =IIf([ControlName] Is Null, 0, fieldname), but I get an
error. Any suggestions?
 
Back
Top