Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Multiple operations within a form

Posted on 2000-05-02
2
Medium Priority
?
165 Views
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
K=1-(H/L)
L=I/(1-J)
M=C * L

How do I do this?
0
Comment
Question by:kevsh
2 Comments
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 750 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 !!
0
 

Author Comment

by:kevsh
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?

Thanks
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

963 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