Results 1 to 5 of 5
  1. #1
    anoble1 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    7

    Trying to total some values from a form and a subform


    I am having an awful time trying to get a grand total.
    Any help on how I can total these values using code outside a query?

    I can't even get a total from this form. I tried putting a sum in there and it will not work.
    Code:
    =[frmPODetails].[Form](Sum([txtTotalPrice]))
    Click image for larger version. 

Name:	2017-08-29 16_51_35-Access - Buckets _ Database- C__Users_anoble_Documents_Buckets.accdb (Access.jpg 
Views:	12 
Size:	38.2 KB 
ID:	30136

  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,652
    Have you tried this in a textbox in the footer?

    =Sum([txtTotalPrice])
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    anoble1 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    7
    Just tried it. Same problem. Says Error on the bottom still.

    If it helps the txtTotalPrice is a calculated text box through vba.


    Quote Originally Posted by pbaldy View Post
    Have you tried this in a textbox in the footer?

    =Sum([txtTotalPrice])

  4. #4
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The total uses fields that are on the record source of the form, so if you want to put the expression into the control source of this total then it must refer to fields in the record source, not fields on the form. If it needs to be calculated differently, then you will have to do it in code, same as the txtTotalPrice.

  5. #5
    anoble1 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Jun 2015
    Posts
    7
    Got it. I think that was the problem. What I did was created a new textbox that formed a total of the sub report Form Footer. Then took that total and created a grand total on the Main Form Footer. Seems to work fine now. Thanks for the help.

    Quote Originally Posted by aytee111 View Post
    The total uses fields that are on the record source of the form, so if you want to put the expression into the control source of this total then it must refer to fields in the record source, not fields on the form. If it needs to be calculated differently, then you will have to do it in code, same as the txtTotalPrice.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-22-2016, 07:43 AM
  2. Subform total on main form
    By muhammadirfanghori in forum Forms
    Replies: 1
    Last Post: 03-12-2015, 08:42 AM
  3. Replies: 19
    Last Post: 06-30-2014, 04:36 PM
  4. Running Total on Form with Subform
    By Njliven in forum Forms
    Replies: 1
    Last Post: 06-18-2013, 11:49 AM
  5. Replies: 2
    Last Post: 02-12-2013, 11:23 AM

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