Count function showing #Error when no Record

Joined
Aug 20, 2009
Messages
1
Reaction score
0
I have a calculated field that consists of the expression
"=Count([lastname])" which works fine as long as there are some records in
the underlying record source. However, when there are no records to count,
the field displays the #Error value. I tried using the Null to Zero
function NZ() to eliminate the #Error:

=Count(nz([lastname]))

but that didn't work because I still got the #Error.

The following function
=nz(Count([lastname]),0)
did not work either.

Can anyone tell me how I can count the records and return a text string like
"no records" or a 0 when the recordset is empty, instead of getting the #Error when
there are no records to count?

Thanks in advance.
Lizzy
 
Back
Top