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

#Error 1

Status
Not open for further replies.

integritycare

Technical User
Mar 12, 2011
151
AU
Hello,
I am looking for a solution to removing this error (#Error) on a report when there are no calculations available.
It appears on a sales report when no data is present.

Thank you,

Integrity
 
Hello,

I have found a solution in Allen Brownes Page.
1.
Code:
=IIf(FormHasData([Form]),Sum([Invoicetotal]),0)

This form that the code is on is a subform

I use this code on the mainform

Code:
=[subformPanel].[Form]![T7]
to get the data from the subform to mainform.
How can I use similar code as in 1 above for the main form so that the #Error is prevented?


2. Also using the count method on a report
Code:
(=Count(*)
How do I prevent the same error when there is no data?

Regards,

Integrity
 
Please clarify:
1. What version of Access are you using?
2. Are you getting #Error only on a subreport, or both sub and main?
 
Hello, trevil620 & dhookom,

Thank you for your replies.


trevil620
The DB is in Access 2003. I have worked out the code for the subform so its only the mainform that now has any issue with the #Error.

I have at present tried this code on the control source on the textbox on the mainform
Code:
=nz([subformPanel].[Form]![T7],0)

But when the subform has no data the #Error still occurs.

dhookom
On the reports the #Error is now rectified except for counting of the records, which I have used




Code:
=Count(*)
on the control source of an unbound textbox. It would just tidy up the reports if I could get this count to show a "0"

Thank you
Integrity

 
Thanks Duane for this.

I will post the other query on the forms page where it should have been.

Regards

Integrity
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top