?
Solved

Access Continuous Form Subtotal Textbox #Error

Posted on 2014-02-18
5
Medium Priority
?
1,633 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 49

Accepted Solution

by:
Dale Fye earned 2000 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 49

Expert Comment

by:Dale Fye
ID: 39868541
glad to help.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

809 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