Results 1 to 3 of 3
  1. #1
    lynthel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    30

    Problem summing multiple fields into one field

    I have 5 text boxes.

    txtA1 (currency, Enabled = Yes)
    txtA2 (currency, Enabled = Yes)
    txtA3 (currency, Enabled = Yes)
    txtA4 (currency, Enabled = Yes)
    txtTotal (currency, Enabled = No)

    They are bound to these currency fields.

    A1
    A2
    A3
    A4
    Total - is a calculated field that I used the wizard to complete which contains:
    [A1]+[A2]+[A3]+[A4]

    Each of the "txtA" fields has an "after update" of:
    Me![txtTotal].Requery (when I try using Me![Total].Requery, I get a Run-Time error '438': Object doesn't support this property or method)



    My problem is the value in txtTotal does not display Total and when manually looking up the value of Total, it is not calculating.

    Can anyone please help out?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    50,123
    The Requery method is to requery things like form RecordSource and combo or list box RowSource. A textbox has neither.

    Textbox expressions will recalculate automatically whenever one of the term's values changes. Calculated data does not automatically save to a field in table and really should not be saved to table. Calculate the value whenever needed.

    Arithmetic with null produces a null result. If any of the terms is null the result will be null. Deal with possible null.

    Nz([A1],0)+Nz([A2],0)+Nz([A3],0)+Nz([A4],0)
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    lynthel is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2013
    Posts
    30
    Quote Originally Posted by June7 View Post
    The Requery method is to requery things like form RecordSource and combo or list box RowSource. A textbox has neither.

    Textbox expressions will recalculate automatically whenever one of the term's values changes. Calculated data does not automatically save to a field in table and really should not be saved to table. Calculate the value whenever needed.

    Arithmetic with null produces a null result. If any of the terms is null the result will be null. Deal with possible null.

    Nz([A1],0)+Nz([A2],0)+Nz([A3],0)+Nz([A4],0)
    I removed the Requery's from all "A" after updates.
    I inputted your code into the control source...
    And Bam! It worked!

    Thank you, June7

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

Similar Threads

  1. Summing Multiple Queries & Summing Time
    By WEJ in forum Queries
    Replies: 2
    Last Post: 10-04-2013, 04:46 PM
  2. Replies: 7
    Last Post: 01-02-2013, 11:23 PM
  3. problem with summing 2 columns
    By kwooten in forum Queries
    Replies: 1
    Last Post: 03-01-2012, 02:44 PM
  4. Grouping, Summing, and Ranking Problem
    By cadsvc in forum Reports
    Replies: 3
    Last Post: 04-16-2011, 11:34 AM
  5. Replies: 1
    Last Post: 12-10-2009, 08:41 PM

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 - Senior Forums