Results 1 to 3 of 3
  1. #1
    cfwoodbury is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    11

    #Error in total of subform values when no records in subform


    I am sure this must have been asked before. I have a simple main order form with a subform showing items ordered. I use a pop up form to actually populate the table on which the subform is based. When I open the mainfom, of course, there are no records in the table. So the TotalAmount field on the main form showes #Error. As soon as I add an item the total field works properly. It seems that if there are no records in the subform the main form total would be null. But, I have tried the NZ function and other means to test for null to no avail.

    This is really only a cosmetic issue since things work fine once we start adding detail records. But, it would be nice to have the #Error not show up.

    Thanks,

  2. #2
    always404 is offline Novice
    Windows XP Access 2007
    Join Date
    Jan 2013
    Posts
    19
    What is the Control Source for the TotalAmount field?
    How are you getting the total number of orders into that control?

    You might be able to properly set the Total Amount field manually.
    Or you might need to edit the expression you're using for you control source.

  3. #3
    cfwoodbury is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    Oct 2012
    Posts
    11
    Thanks for your response. As often happens, with a little more trial and error I have come up with a solution. Because I do not want the user to be able to enter or modify records in the subform, I had set the AllowEdits, AllowDeletions and AllowAdditions properties on the subform to "no". So, upon opening the main form, the subform was completely empty. Changing AllowAdditions to "yes" causes a blank line to be entered in the subform when the main form is opened and then the #Error in the total fields is not present. Since all of the visible fields on the subform are locked, the user still cannot enter data directly to the subform. I use a pop up form to create table entries and as I enter items the totals all work fine.

    Thanks again,

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Total from subform column?
    By CyberRaptor in forum Forms
    Replies: 2
    Last Post: 01-17-2013, 05:25 PM
  2. Total Control Value in SubForm
    By libraccess in forum Forms
    Replies: 4
    Last Post: 06-06-2012, 01:34 AM
  3. How to total a column of numbers in a subform?
    By snowboarder234 in forum Forms
    Replies: 3
    Last Post: 04-24-2012, 09:39 AM
  4. Displaying a total textbox in a subform
    By rmohebian in forum Access
    Replies: 3
    Last Post: 02-08-2011, 01:05 PM
  5. Running Total in Subform
    By Scorpio11 in forum Forms
    Replies: 19
    Last Post: 07-03-2010, 05:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums