Solved

Access Continuous Form Subtotal Textbox #Error

Posted on 2014-02-18
5
1,507 Views
Last Modified: 2014-02-18
Hello experts!

I have a form with a subform.  The subform's info comes from a query.  In the Footer of the Subform I put an unbound textbox.

The continuous form's bound field is [AmtIn].  In the footer I put the formula
=nz(Sum([AmtIn]),0)

Everything works great EXCEPT when the query results in "No Records".  Then I get the dreaded #Error which throws every other calculated field on the Form to #Error.

Am I doing something wrong or is this a Access 2007 bug that was never fixed?
0
Comment
Question by:wlwebb
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Kelvin Sparks
ID: 39868276
Have you tried Sum(Nz([AmtIn],0))?

I think you need to do the Nz bit before the sum not after.

Kelvin
0
 
LVL 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 500 total points
ID: 39868277
How about basing the other controls which are based on the txt_Total control in the subform with a control source of something like:

=IIF(IsError(me.subformcontrol.form.txt_Totals), 0, me.subformcontrol.form.txt_Totals)
0
 

Author Comment

by:wlwebb
ID: 39868482
Kevin.

Doesn't work if Query has no records.
0
 

Author Closing Comment

by:wlwebb
ID: 39868517
Thanks Fyed.....  Works like a charm... Tried Iserror but my syntax was wrong.  Thank you
0
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39868541
glad to help.
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question