Results 1 to 9 of 9
  1. #1
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494

    Sum unbound field in form footer

    I am trying to sum an unbound field in my continuous form footer.

    User opens car form. Clicks on button and it opens a new form with only entries from the storage table that match the id on the open car form.

    The control source for the unbound field is a calculation which works and is called GrandTotal



    The formula in the footer of the form is =sum(GrandTotal)

    However, I get #error

    i have also tried =sum(Nz(GrandTotal),0)

    And that does not work either.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    You can't sum a control, only a field. You can move the calculation out to the form's source, or sum the calculation, like:

    =Sum(Price * Quantity)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Perhaps create a field in your query called totalsimilar formulae to the rowsource in your form)

    Then use a dsum formula to find the sum of the "totals" which match the criteria. The dsum formula could then be the control source of the text box


    Sent from my iPad using Tapatalk

  4. #4
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    I have even tried to sum the fields

    =sum(dailystorage)

    still yields an #error and daily storage is a regular field.

    I was going to just try to sum each field individually and them add them up but that wont work if I cant even sum a field. Do I need to explicitly declare the form.field or some kind of parent.field type code?

    I tried =sum([Forms]![Myform]![MyField]) syntax and that didn't work either.

  5. #5
    andy49's Avatar
    andy49 is offline VIP
    Windows 10 Access 2007
    Join Date
    Nov 2016
    Location
    London
    Posts
    1,051
    Is daily storage the name of a filed or a control?


    Sent from my iPad using Tapatalk

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Is the textbox in the form footer or page footer? It should be form footer.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    It is in the form footer.
    I am using the field name in the calculation

    I thought I had done this before so I checked. What I did before was create a form and then add a subform to that form. Then on the main form i could sum the items on the subform.

    I think I will move to that.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    If you're still having trouble, attaching the db here could help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    tagteam is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2013
    Posts
    494
    I changed my form so that I have a main form with a continous subform and i can sum the fields at the bottom of the subform.

    However, I ran into another issue. After adding 5 or six unbound fields that sum I started getting #Error in the fields and the field that I used to sum the subform on the main form says #Size!

    I guess there is a limit on the number of unbound fields you can use to sum. Does anyone know what that limit really is?

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

Similar Threads

  1. Replies: 3
    Last Post: 11-29-2016, 10:03 AM
  2. Replies: 14
    Last Post: 05-01-2015, 10:36 AM
  3. Replies: 5
    Last Post: 01-30-2015, 02:45 PM
  4. Connecting Unbound Field to Form
    By hithere in forum Forms
    Replies: 1
    Last Post: 09-04-2013, 11:56 PM
  5. Replies: 8
    Last Post: 04-29-2013, 12:11 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