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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Count showing #Error instead of 0 on form 1

Status
Not open for further replies.

jcfraun

Technical User
Dec 13, 2008
51
US
I have a text box on a form that displays the number of records in a subform using the following expression
=[Form]Form!Text10, where Text10 refers to a text box with
=count([Field]) in the form's footer. It works well, except when the value is 0. Then it gives me an #Error. Any ideas?
 
How are ya jcfraun . . .

Try:
Code:
[blue]=Nz(count([Field]))[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks TheAceMan1, but that didn't work this time. The error remains....
 
=iif(iserror(count(field), 0, count(field))
I assume this happens when the recordset is empty.

HTH

[pipe]
Daniel Vlas
Systems Consultant

 
jcfraun . . .

Rereading your post origination I find that
Code:
[blue]=[Form]Form!Text10[/blue]
makes no sense (I'm truly surprised no error is raised period!). Try the following ([blue]you![/blue] substitute proper names in [purple]purple[/purple]):
Code:
[blue]=[[purple][b][i]subFormName[/i][/b][/purple]].[Form].[recordset].[RecordCount][/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Danvlas - Thanks! That worked. I ended up having to use the ISERROR in the text box on the main form, but we have success.

TheAceMan1 - I'm new to this whole Access forum thing! It really did make sense - probably just my post that was confusing.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top