Using @Sum to calculate form field totals

Posted on 2006-04-07
Last Modified: 2013-12-18
Hi all,

I have a form that has a number of user input fields.
At the bottom of the form I have a field which finds the total of these fields using @Sum

My question is, how can I have the user input fields be blank when a new document is created?
i.e. I don't want to have to put 0 as the default value for all these fields.

At the moment I am nearly there using this:

res:=@Sum(@TextToNumber(@Trim(@Text(basic_hours + basic_hours_1 + basic_hours_2 + basic_hours_3 + basic_hours_4 + basic_hours_5 +basic_hours_6))));

However, this obviously only displays the total when all fields have a value.
Is there any way around this problem?

Question by:shuboarder
    LVL 14

    Accepted Solution

    Wonderful tip from sjef:

    a:= 4;
    b:= 10;
    c:= "";
    d:= 6;

    LVL 21

    Author Comment

    That Sjef is a clever chap ;)
    LVL 14

    Expert Comment

    Yeah my bro is ....
    LVL 46

    Expert Comment

    by:Sjef Bosman
    ^ | ^

    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

    For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    734 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

    19 Experts available now in Live!

    Get 1:1 Help Now