Display other than "#null!" for divison of Null values

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

Guest

I have a field that is a percentage of two sums divided. When the values are
null, of course it displays the error "#null!". How do I get around this and
show "100%" ? Any ideas? Been trying the IIF method, but to no aval.
Thanks.
 
Hi,
you could either use this in the query the report is based on:

=Nz([YourField],0)

And therefor the caculations on the report would display accurately, or you
can do this on the report directly if you don't want to use it in a query
with:
=IIf([Divisor]=0,"",[Dividend]/[Divisor])

HTH
Good luck
 
It would help if you displayed what you attempted. I'm assuming that you
are trying to do this in a control on a form. You might try the following.

=[FieldA]/ IIF([FieldB]<>0,[FieldB],[FieldA])

You could use the print event of the relevant section and use
If Me![FieldB] <> 0 Then
Me.TheControlName = Me!FieldA/Me!FieldB
Else
Me.TheControlName = 1
End If
 
Already tried all those things. The key I believe, is that the format is set
to Percentage. So in essence, whatever the value is, is a percentage. When
I leave it blank or with a number, I still get the error? I have this in the
controlsource in the Report:


=IIf(IsNull([Sum of Twins1]),"",[Sum of Twins1]/[SumofTwins11])

I have replaced the true return with misc values and variables, but still
get an error.
 
Back
Top