Results 1 to 5 of 5
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    sum not working


    All, using 2010. I have a subform on a form. I am trying to show a total on the main form from the subform. On the footer of the subform; I have a textbox:
    Code:
    =sum([fieldname])
    I put a textbox on the mainform:
    Code:
    ]=[sfrmPayroll].[Form]![SAnnualPayrollTot
    . I put the name of the control from the subform. It gives me: #error. Please tell me what Im doing wrong.

  2. #2
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think the problem is how you are referencing the subform control.
    See http://access.mvps.org/access/forms/frm0031.htm

    Something like:

    Me!Subform1.Form!ControlName
    or
    Forms!Mainform!Subform1.Form!ControlName


    Sorry I can't be more specific - I don't know your main form/ sub form names......

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    When I put the textbox with the sum([fieldname]) on the subform and make it visible; it gives me that error. So it's before I even try to show the sum on the mainform. The field is a number data type. I can't figure out what's wrong.

  4. #4
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    For some reason I got it working. Thanks

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    For some reason I got it working.
    Can you post the code from the "working version"? It could be useful to others.

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

Similar Threads

  1. Working query stops working after importing
    By Abacus1234 in forum Import/Export Data
    Replies: 3
    Last Post: 10-25-2015, 09:12 PM
  2. Replies: 13
    Last Post: 01-22-2015, 05:27 PM
  3. Replies: 1
    Last Post: 12-27-2014, 12:38 PM
  4. Dsum was working now it is not working
    By ssalem in forum Reports
    Replies: 7
    Last Post: 04-18-2013, 02:57 PM
  5. Replies: 3
    Last Post: 01-29-2013, 04:34 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