INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

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!

*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.

Jobs

#Error

#Error

(OP)
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

RE: #Error

(OP)
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

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") 

Duane
Hook'D on Access
MS Access MVP

RE: #Error

(OP)
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

RE: #Error

(OP)
Thanks Duane for this.

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

Regards

Integrity

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!

Resources

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