Results 1 to 5 of 5
  1. #1
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40

    Form Subform calculated field works only when it "feels like it"

    Hi. I have a form that has a field that is used to show a calculated field from a subform. Sometimes it works like it is supposed to but more often than not I get a "#Name? error". I'm baffled as to why it works sometimes but not others. Haven't been able to make rhyme or reason of it.

    The subform is used to show items ordered. It has a calculated field in the form footer called "subtotal". The subtotal sums the subform field named '"DosePrice" by using the following control source "=Sum([DosePrice])". Both the DosePrice field and the subform field are currency fields.



    The subform name within the form is "Tracker_Subform". The field within the main form is called "GrandTotal" (also a currency field). The control source for GrandTotal is "=[Tracker_Subform].[Form]![subtotal]"

    So as I have stated it will sometimes work properly but more often than not I get the #Name? error. Anyone have any experience with these type of issues? I'm really at my wits end trying to figure this out. Thanks in advance!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    I too see this. Have you tried on the main form ON CURRENT event to refresh it?
    GrandTotal.Requery

    Its possible the subform hasnt finished adding yet when main form can show its value.
    or conversly, update the mainform.grantotal from the subform.

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Is DosePrice an entered value or is it, too, a calculated field?

    Linq ;0)>

  4. #4
    jree3000 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jun 2014
    Posts
    40
    Missinglinq, DosePrice is an entered value.

    However I think ranman256's suggestion fixed it! It appears to be working properly now. Thank you!

  5. #5
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Is DosePrice an entered value or is it, too, a calculated field?

    Also, although we usually think of Forms or entire Databases when we speak of corruption, individual Controls can and do become corrupted. The test and the fix are one and the same; deleting the Control then re-creating it! If it was corrupt, you've verified the fact and solved the problem! Because of the 'sometimes it works, sometimes it doesn't' aspect of the problem, this is a real possibility, so I'd do the above to the calculated Control on the Subform, and if that doesn't solve it, do the same to the Control on the Main Form.

    Linq ;0)>

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

Similar Threads

  1. Replies: 22
    Last Post: 09-04-2014, 09:12 PM
  2. Replies: 3
    Last Post: 04-22-2013, 06:08 AM
  3. Avoiding "#Error" in Calculated Field
    By Aaron5714 in forum Forms
    Replies: 1
    Last Post: 01-22-2013, 03:43 PM
  4. Column sum works in "Detail" but not "Footer"
    By Doodlebug2000 in forum Reports
    Replies: 1
    Last Post: 12-10-2012, 03:20 PM
  5. Replies: 16
    Last Post: 07-22-2011, 09: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