Question : How to prevent #Null! in an access report

I have a report that sometimes fields don't have values.  So I'm getting #Null!.... I'm tried to use Nz but it didn't help.

Here is the field, its a text box in the report:

=Format(Count(IIf(Left([LensSelect],2)="B ",0))/Count(IIf([RxType]="Progressive",0)),"00.0%")

Anything else I can try?

Answer : How to prevent #Null! in an access report

There might be a division by zero there. Make sure

Count(IIf(nz([RxType],"")="Progressive",0))

is never zero using again Iif function.

It could be

IIf (Count(IIf(nz([RxType],"")="Progressive",0))>0, Count(IIf(nz([RxType],"")="Progressive",0)), 0 )

It would be better to store Count(IIf(nz([RxType],"")="Progressive",0)) in another hidden control and use its value in the formula.
Random Solutions  
 
programming4us programming4us