NEED ZERO IN COUNT EXPRESSION

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

Guest

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?
 
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
 
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))
 
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?
 
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top