adding values in textboxes MS Access

Posted on 2012-09-10
Last Modified: 2012-09-11
I have an access form with 4 textboxes on it formatted as currency.


The user will enter dollar values in the first 3 textboxes and I want the total displayed in textboxTOTAL.  If the user makes a change to any of the values,  I want the total to be recalculated.  And how do I avoid confusing things such as when a total already exists in textboxTOTAL and the user makes a change to any of the texboxes that is not immediately reflected in textboxTOTAL.

For example, let's say these are currently the textbox values:

textbox1                  $1000
textbox2                  $5000
textbox3                  $4000
textboxTOTAL        $10000

Now let's say a user deletes the data in textbox1.   How do I avoid things like the following:

textbox2                  $5000
textbox3                  $4000
textboxTOTAL        $10000    <----value is still showing $10K even  

So I'm also looking for the proper way to handle recalculations. Thank you.
Question by:dbfromnewjersey
    LVL 75

    Accepted Solution

    Control source for textboxTOTAL

    =Nz([textbox1],0) + Nz([textbox2],0) + Nz([textbox3],0)

    This deals with Null values

    It should ... recalc automatically.  Try the above and report back in still updating.


    Author Comment

    Thank you.
    LVL 75

    Expert Comment

    by:DatabaseMX (Joe Anderson - Access MVP)
    You are welcome ...


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
    What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now