#Error from Count

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
 
L

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
 
D

Duane Hookom

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
 

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

Top