Multiple operations within a form

Posted on 2000-05-02
Last Modified: 2013-12-18
I am creating a form with 13 fields.  2 of the fields are constants (field A and B), 4 of the fields need user input (fields C, D, E, J), and the remaining fields (fields F, G, H, I, K, L, and M )are formulas pulling the data from the 2 constant and 4 user inputted fields. I want to make it so the user enters the data for fields C, D, E, J, and by saving the form, the rest of the fields automaticlaly calculate.  To elaborate on the formula fields:

F=A * E
G=F * B
H=D + F
I=H + G
M=C * L

How do I do this?
Question by:kevsh

Accepted Solution

Simon_Hendry earned 250 total points
ID: 2771406
If you want to make the fields auto calculate on saving ( or refresh ) then you have a couple of options..

1) write so lotus script code that does the calculations and store it in QuerySave Event of the form..

2 ) Use calculated values for the the other fields

Here is 2)

You will also obviusly need to setup "input validation" formulas for the fields C,D,E and F since the other fields use these values to calculate themselves...

so for C,D,E,F use the "INPUT VALIDATION" formulas like

@If(C="";@Failure("You must enter a value for C");@Success);

Now for your calculated fields make them "computed" with a value of :

Field F

@If(A!="" & E!="";A*E;0)

Field G

@If(F!="" & B!="";F*B;0)

Field H

@If(D!="" & F!="";D+F;0)

Field I

@If(H!="" & G!="";H+G;0)

Field K

@If(H!="" & L!="";1-(H/L);0)

Field L

@If(L!="" & J!="" ;I/(1-J);0)

Field M

@If(C!="" & L!="" ;C*L;0)
I have noticed that some of your formulas may cause an error such as I/1-J is infinite if J =1 so your may want to change the formula to

@If(L!="" & J!="" & J!=1 ;I/(1-J);0)

Also, notes computes fields top to bottom left to right , so you will need to store the fields that are dependent on other fields below those fields i.e on your form the order of your fields should be

F , G , H , I , L , K , M

This is because K uses the value of L so it needs to be calculated first

Hope this helps !!

Author Comment

ID: 2835523
Great, though when I save the first time, I get an error within field k, yet when i press save again, than field K correctly calculates.  I have the order of fields like you described above.  Can you help asto why I would need to press save twice for all of my fields to calc?


Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Recent Contacts - Lotus Notes 10 696
Lotus Notes 8.5 1 158
Incorrect reply-to address Lotus 2 37
Migration: Lotus Notes to Exchange 2013 10 330
  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

820 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