Results 1 to 5 of 5
  1. #1
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42

    Totals from subform to main form

    I have two separate forms that have embedded subforms where I need totals to show in the main form. For one of the forms it is working great. On the other form it is not working.

    The field on the subform is a calculated field (LineTotal):
    =[MSRP]*[Quantity]
    this works, but when I put when I put
    =Sum([LineTotal]) in the footer it is returning an error

    I thing if I can figure out my mistake here I can get through the rest of this

  2. #2
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    It isn't a calculated FIELD it is a calculated CONTROL. So you need to use the same fields:

    =Sum([MSRP]*[Quantity])

  3. #3
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    That was too simple. The total works on the subform (field name is DetailTotal) but when I use

    =[Forms]![SODetailExtended Query subform]![DetailTotal]

    in the main form I get the #Name? error

  4. #4
    boblarson is offline --------
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2011
    Posts
    1,272
    Quote Originally Posted by kathi2005 View Post
    That was too simple. The total works on the subform (field name is DetailTotal) but when I use

    =[Forms]![SODetailExtended Query subform]![DetailTotal]

    in the main form I get the #Name? error
    Don't use that method. It is probably going to want

    =[SODetailExtended Query subform].[Form]![DetailTotal]

    (and it isn't field name, it is TEXT BOX NAME, correct? Fields are in tables and queries and controls are on forms and reports and can be bound to fields. It is important to not use the word field interchangeably - even though I find myself falling into that same trap occasionally as old habits die hard)

    Now if the suggested control source that I gave doesn't work, I find this method to be the easiest to get the right value there:
    http://www.btabdevelopment.com/ts/refer2sfrms

  5. #5
    kathi2005 is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    42
    once again that was too simple.

    hopefully with what you have taught me today I can finish this thing

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

Similar Threads

  1. Controlling Subform from Main Form
    By SteveF in forum Forms
    Replies: 5
    Last Post: 07-01-2011, 05:32 PM
  2. Adding totals to a form from a subform
    By Niki in forum Access
    Replies: 13
    Last Post: 05-13-2011, 12:17 AM
  3. Subform in a Tab Control on a Main form
    By jpkeller55 in forum Access
    Replies: 4
    Last Post: 01-08-2011, 12:31 PM
  4. Subform won't display in main form
    By Lynn in forum Forms
    Replies: 15
    Last Post: 03-22-2010, 10:17 AM
  5. Subform vs main form calculation
    By fadone in forum Forms
    Replies: 17
    Last Post: 12-21-2005, 07:27 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