NEED ZERO IN COUNT EXPRESSION

T

tinladie

I have a count expression in a field, but if there is no information I get
#error. How do I have it print a zero if there is no info in the field?
 
T

tinladie

I couldn't get that to work. Here is what I have:

=Count([TYPE OF LOAN])

When there are no loans I get the #Error
 
D

Dennis

Where is this field ? On a form, subform, report, subreport ?
Maybe the DCount function would be better instead of the Count function.

tinladie said:
I couldn't get that to work. Here is what I have:

=Count([TYPE OF LOAN])

When there are no loans I get the #Error

Dennis said:
Try this
=IIf(IsError(Count(expression)),0,Count(Expression))
 
T

tinladie

The field is on a report. What is DCount?

Dennis said:
Where is this field ? On a form, subform, report, subreport ?
Maybe the DCount function would be better instead of the Count function.

tinladie said:
I couldn't get that to work. Here is what I have:

=Count([TYPE OF LOAN])

When there are no loans I get the #Error

Dennis said:
Try this
=IIf(IsError(Count(expression)),0,Count(Expression))

:

I have a count expression in a field, but if there is no information I get
#error. How do I have it print a zero if there is no info in the field?
 
D

Dennis

DCount allows you to count from any table or query with criteria even if the
data does not belong in the data that your form or report is based on.
DCount("[Field Name]","[Table or Query]","Optional Criteria")
For your example you could use
DCount("[TYPE OF LOAN]","[TABLE or QUERY CONTAINING TYPE OF LOAN]")

tinladie said:
The field is on a report. What is DCount?

Dennis said:
Where is this field ? On a form, subform, report, subreport ?
Maybe the DCount function would be better instead of the Count function.

tinladie said:
I couldn't get that to work. Here is what I have:

=Count([TYPE OF LOAN])

When there are no loans I get the #Error

:

Try this
=IIf(IsError(Count(expression)),0,Count(Expression))

:

I have a count expression in a field, but if there is no information I get
#error. How do I have it print a zero if there is no info in the field?
 
Top