Solved

Subtracting values between two fields

Posted on 2003-12-10
10
284 Views
Last Modified: 2013-12-18
Here are some quick points:

field1, "firstnumber" = number/editable
field2, "secondnumber" = number/editable
field3, "resultnumber" = number/computed

User enters a number value in field1
User enters a number value in field2
Field3 automatically shows the value of field1 minus field2

What formulas do I need in all three fields for this to work, including checking to make sure that user enters a number, (as opposed to text), etc.?
0
Comment
Question by:jtpatten
  • 4
  • 3
  • 3
10 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9914696
You don't need any formula in the first and second, Notes will take care of validating that they are numbers.

In the third, the formula should be:

result := firstNumber - secondNumber;
@If(@IsError(result); ""; result)
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9914729
Usually if you enter data type other than defined by field information.. the app will automatically raise the data type mismatch errors.

The formula is quiet simple.. in the default value section of the field3 enter this formula

@If(@IsNumber(Field1) & @IsNumber(Field2); FIELD1 - FIELD2; 0)

~Hemanth
0
 

Author Comment

by:jtpatten
ID: 9914742
qualetee,

Notes accepts this but nothing shows in the result field when numbers are entered and the form is refreshed?
0
 

Author Comment

by:jtpatten
ID: 9914767
HemanthaKumar,

Your answer seems to always post a zero in the results field no matter what is entered in the other two fields?
0
 

Author Comment

by:jtpatten
ID: 9914791
HemanthaKumar,

Sorry, your answer does work, I had something else hosed.

Respond back so I can accept for you.

Thanks,

Jack
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 24

Accepted Solution

by:
HemanthaKumar earned 250 total points
ID: 9914830
The problem is the computed field will not just refresh unless something triggers

1. Hit F9 key to manually refresh
2. When you exit of field2, write a script which triggers a refresh

Dim ws as New NotesUIWOrkspace
ws.UIDocument.Refresh

0
 

Author Comment

by:jtpatten
ID: 9914875
HemanthaKumar

What would I have to add to the results field formula so that if there is nothing entered in the first two fields the results field will show blank?

Right now it shows a zero.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9915470
Use my formula, and it will show blank.  Use Hemantha's formula, it will show zero.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9915635
@If(@IsNumber(Field1) & @IsNumber(Field2); FIELD1 - FIELD2; "")
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9916509
If this is  VERY SIMPLE form, you can also enable th form property, "Automatically Refresh Fields," which would update as soon as you tab out of field 2.

This isn't work for a Notes AD I class, is it?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating a bat file fo Note.ini 4 202
Missing Rules 1 294
Scan to Email - HP 477 Printer and Lotus Notes 8 71
Code for extraction to mkdir folder 5 50
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…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

863 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

21 Experts available now in Live!

Get 1:1 Help Now