Totaling 3 fields on form.

I've got 3 numeric/editable fields (Fld1,Fld2,Fld3) on a form, which are totaled into a fourth field (TotFld).
I want to have the total (TotFld) calculated whenever a change is made to any value in fields Fld1, Fld2, or Fld3.  

I'd like to avoid using the 'Form Refresh' property. Possibly performing the calculation in the "Exiting" event of each field???

Can someone provide the Lotuscript and where it needs to be placed to get this to happen.

Thanks,
SAK
LVL 1
SAKAsked:
Who is Participating?
 
HemanthaKumarConnect With a Mentor Commented:
Copy this to all of the "fld#"

Sub Exiting(Source As Field)
     Dim ws As New NotesUIWorkspace
     Dim note As NotesDocument
     Set note = ws.CurrentDocument.Document
     note.Total = note.FLD1(0) + note.FLD2(0) + note.FLD3(0)
End Sub

And Make the total a computed field.

~Hemanth
0
 
HemanthaKumarCommented:
Replace Total with TOTFLD in script so suit your form.
0
 
SAKAuthor Commented:
That's exactly what I was looking for.
THanks!
SAK
0
 
HemanthaKumarCommented:
Anytime.
0
All Courses

From novice to tech pro — start learning today.