This #Error appear to me when there is no records

  • Thread starter Thread starter a
  • Start date Start date
A

a

{{{{{{ access 2007}}}}}}

This #Error appear to me when there is no records

All text box formula work correctly when there are records

My question is :

How can I use (0) in the formula to give me (0) when no records

For example

=Count ("ID")

Where can I put 0 in this example

Any tips information about using 0

Thank you
 
a said:
{{{{{{ access 2007}}}}}}

This #Error appear to me when there is no records

All text box formula work correctly when there are records

My question is :

How can I use (0) in the formula to give me (0) when no records

For example

=Count ("ID")

Where can I put 0 in this example


If you want to count all records (not just the non-Null ID
values), then use =Count(*) instead.

In many other situations, you can get away with using:
=IIf(IsError(Count ("ID")), 0 , Count ("ID"))

If the count is in a subreport and you are trying to display
it on the main report, then use:
=IIf(subreport.Report.HasData,subreport.Report.txtTotal,0)

Another reason you might get #Error is if ID is not a field
name in the record source or if some other text box uses an
aggregate function that also generates #Error
 
Back
Top