Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here




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,


RE: #Error


I have found a solution in Allen Brownes Page.



This form that the code is on is a subform

I use this code on the mainform


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


How do I prevent the same error when there is no data?



RE: #Error

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

RE: #Error

If this is a report as suggested, you can use an expression in a control source like:

CODE --> ControlSource

=IIf([HasData],[YourExpressionHere],"No Data") 

Hook'D on Access
MS Access MVP

RE: #Error

Hello, trevil620 & dhookom,

Thank you for your replies.

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



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

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


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

RE: #Error

Thanks Duane for this.

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



Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close