#Error from Count

  • Thread starter Thread starter Leif
  • Start date Start date
L

Leif

I'm trying to show a total count of the records in a report. In the report
footer I have the function "=Count([pmocid])" where pmocid is a field in the
report detail. Works fine until there are no records in the report. Then I
get a "#Error". I tried =Count("*") instead, but I got the same error.
Anyway to trap this problem and drop in a zero, or another way around the
problem?

Thanks,
Leif
 
Thanks, that's a new one for me. So the HasData is like a pseudo column?

Duane Hookom said:
Check for HasData
=IIf([HasData],Count(*),0)
--
Duane Hookom
Microsoft Access MVP


Leif said:
I'm trying to show a total count of the records in a report. In the report
footer I have the function "=Count([pmocid])" where pmocid is a field in the
report detail. Works fine until there are no records in the report. Then I
get a "#Error". I tried =Count("*") instead, but I got the same error.
Anyway to trap this problem and drop in a zero, or another way around the
problem?

Thanks,
Leif
 
HasData is a property of the report. This property will return true or false
depending on if the report's recordsource has any records.
--
Duane Hookom
Microsoft Access MVP


Leif said:
Thanks, that's a new one for me. So the HasData is like a pseudo column?

Duane Hookom said:
Check for HasData
=IIf([HasData],Count(*),0)
--
Duane Hookom
Microsoft Access MVP


Leif said:
I'm trying to show a total count of the records in a report. In the report
footer I have the function "=Count([pmocid])" where pmocid is a field in the
report detail. Works fine until there are no records in the report. Then I
get a "#Error". I tried =Count("*") instead, but I got the same error.
Anyway to trap this problem and drop in a zero, or another way around the
problem?

Thanks,
Leif
 
Back
Top