Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I currently have an Access 2000 Db,

Status
Not open for further replies.

IndyGill

Technical User
Jan 15, 2001
191
GB
I currently have an Access 2000 Db, which produces a report

The problem
I have a footer which counts the number of records outputted by the report, which is:

=Count(*)

However if there is no records to count it returns a "Error" value, how do I get it to return a "0" value

I have also tried =Nz(Count(*),0)

But this does not seem to work, again all I get is the "Error" sign rather than a Zero value.

I need to gain the zero value as this value is then used in the same report within a sum. The sum fails because the count returned a Error value.

Many thanks in advance.... from a very confused user

Indy
 
I've got about 10 daily reports I send every morning that count just about everything there is to count.

If possible, use the field that you're basing the query on (like order entry date not being null or better still, your primary key):

Throw a text box in your report header or footer and under Properties/Control Source:

=Count([The_Field_You_Want_To_Count])

or if you're a glutten for pain:

SELECT Count(TableName.The_Field_You_Want_To_Count) AS CountOfThe_Field_You_Want_To_Count
FROM TableName;

I have a feeling you put this in the page footer which is why you got errors.

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top