Results 1 to 5 of 5
  1. #1
    tim_tims33 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Dec 2011
    Posts
    62

    Sum of unbound text boxes not appearing in Form Footer

    Hi, I thought this would be straightforward.



    I have a form with a subform of various items, each with an associated cost. If the user ticks 'paid' field, it should not contribute towards the Sum of the individual costs.

    Click image for larger version. 

Name:	Form.JPG 
Views:	16 
Size:	77.7 KB 
ID:	51082

    For the subform, in the footer, i have tried various permutations to get the Sum of the Amount Remaining textbox (which is unbound). For example, I've tried :
    Code:
    =Sum([txtAmountRemaining])
    
    =Sum(Nz([txtAmountRemaining],0))
    These expressions return an error in the textbox #Error.

    Click image for larger version. 

Name:	Form2.JPG 
Views:	16 
Size:	104.4 KB 
ID:	51083

    When run, it shows error message:

    Click image for larger version. 

Name:	Form3.JPG 
Views:	16 
Size:	36.1 KB 
ID:	51084

    Any ideas on why it's not returning a value?

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Try to use the original expression in the Sum() function instead of referencing the control:
    =Sum(IIF([Paid]=False,....)

    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Not sure why you are summing on what appears to be a single form but either way, you cannot sum unbound textboxes because the summing is based on the form's recordset.

    As an alternative to Gicu's suggestion, include the calculation in your form recordsource - but note this will not recalculate until the record is saved.

  4. #4
    tim_tims33 is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Dec 2011
    Posts
    62
    Thanks Gicu. This worked first time.

  5. #5
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2013 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 3
    Last Post: 02-26-2021, 12:35 PM
  2. Replies: 5
    Last Post: 01-07-2019, 01:51 AM
  3. Hide text boxes when Report Footer displays
    By Paul H in forum Reports
    Replies: 3
    Last Post: 12-01-2017, 05:05 PM
  4. Replies: 9
    Last Post: 11-05-2014, 09:23 AM
  5. Replies: 1
    Last Post: 01-23-2011, 09:21 AM

Tags for this Thread

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