Solved

Verifying totals

Posted on 2002-03-15
22
196 Views
Last Modified: 2013-12-18
Okay..I have four fields on a form.  A B C D  They are all used to input a number of copies needed for a Copy Production Center form.

A + B should always equal C + D

Is there a simple formula or lotus script to add this to the submit button as a validation before submitting the form?  If so, can anyone tell me what that might be?

Thanks so much!
Janette
0
Comment
Question by:jk9783
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 9
  • 8
  • 3
  • +1
22 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 6868626
Does this formula do the job?
FIELD A:=A;
FIELD B:=B;
FIELD C:=C;
FIELD D:=D;

REM "Basic field checking. Do it here or direct in fields...";
@If(@isError(@TextToNumber(@Text(A)));@Return(@Prompt([OK];"Error";"Wrong A value."));"");
@If(@isError(@TextToNumber(@Text(B)));@Return(@Prompt([OK];"Error";"Wrong B value."));"");
@If(@isError(@TextToNumber(@Text(C)));@Return(@Prompt([OK];"Error";"Wrong C value."));"");
@If(@isError(@TextToNumber(@Text(D)));@Return(@Prompt([OK];"Error";"Wrong D value."));"");

REM "This is the Sum check you asked for...";
@If((A+B)!=(C+D);@Return(@Prompt([OK];"Error";"A+B <> C+D"));"");

REM "here flows your submit code...";


=========================================
Of course upper formula works only if your four fields are of type Number.
Otherwise convert the four values to number for checking, like this:
@If((@TextToNumber(A)+@TextToNumber(B))!=(@TextToNumber(C)+@TextToNumber(D));@Return(@Prompt([OK];"Error";"A+B <> C+D"));"");

Good luck,
zvonko
0
 
LVL 10

Accepted Solution

by:
zvonko earned 50 total points
ID: 6869303
Hello Janette,

if you prefer doing it in LotusScript, then use this code:
Sub Click(Source As Button)
  Dim workspace As New NotesUIWorkspace
  Dim uidoc As NotesUIDocument
  Set uidoc = workspace.CurrentDocument
  If ((Cint("0" & uidoc.FieldGetText( "A" )) + _
       Cint("0" & uidoc.FieldGetText( "B" ))) <> _
      (Cint("0" & uidoc.FieldGetText( "C" )) + _
       Cint("0" & uidoc.FieldGetText( "D" )))) Then
    Messagebox( "A + B <> C + D" )  
  Else
    'submit :-)
  End If
End Sub

<|:-)
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6869409
Hi Zvo!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:zvonko
ID: 6869439
Hi Bro :-)
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6870985
you know what ?  I got a cable modem, and now my keyboard is broken.  The internet hates me !
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6870997
still better then your joystick get broken <|;-)

Do you mean Janette can help?

(uups :>) ... I mean with the keyboard :-)



0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6871082
Hey you know what ?  I was so dumb that the switch at the back of the keyboard was off...And i realised it only now!

;-)
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6871815

it is all right as long as you find Karen's dip switches to turn her on ;-)

Keybord is second impotant :-)


0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6871963
haa haa haa that was a good one... by the way who is karen ???

:-P
0
 

Expert Comment

by:giusepe
ID: 6878958
are you working in a form for a web application or notes client ??

this is because if you are doing this submit button for the web, you can accomplish the validation  with JavaScript in the client side !!
0
 

Expert Comment

by:giusepe
ID: 6878963
by the way Arunkumar and Zvonko, you have some information about technical conferences for Domino, Linux, programming, etc. to be held in Atlanta, Georgia USA ??

the thing is that i am going to fly this next wednesday for my holidays to Atlanta and i am trying to get information to assist to some tech conferences.

or maybe you can tell me where i can get this information !!

i am not from United States.

0
 
LVL 10

Expert Comment

by:zvonko
ID: 6879073
sorry to bring bad news, but Antlanta is over:
http://www.lotus.com/world/usa.nsf/frame?OpenForm&/world/usa.nsf/allpublic/024F806B745EFA4685256B4A00586FB5

The next Lotus (IBM :-) DevCon is here:
http://www-3.ibm.com/events/ibmdeveloperworkslive/registration.html

Nice trip anyways,
zvonko


0
 

Author Comment

by:jk9783
ID: 7203785
This is a project that's fallen to the wayside and I don't see me having the time to pick it up again anytime soon.

I have not had a chance to check any of your suggestions (shame on me). I would like to take care of this question, though.

Would you like to share the points or delete the Q or what?  It's up to you guys since I have pretty much wasted your time on this question since I won't have the time to follow through with it.  

I do appreciate all of your help, though.

Janette
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7203800
Hello Janette,

I offered two tested variants, so I vote NOT to give points to my Bro Arun :-)

In any case I am happy you found the time to clean up this question. We have so many abandoned questions here.

And generally, it's nice to here from you again.

 
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7203825
I thought you love me and ask janette to award me pts but you betrayed me my dear brother....

But Samir gave me a 200 just now.

:=)
0
 

Author Comment

by:jk9783
ID: 7203833
No, you're absolutely right.  I've gone through and actually looked at the question and you did offer legitimate help.  It's all yours.

Thanks again!!
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7203881
As you can see Janette we are more joking and having fun here, so do not take it to serious :-)

Thanks for the points and hope next time to be of more help (together with lovely Arun :)

So long,
zvonko

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7203902
You are my bro buddy !

Janette... Its all fun for us here so, dont you worry.  If you still feel something for me then you can post a 500 pt question and award me an "A" for it... I will retire from EE....

:-P
0
 
LVL 10

Expert Comment

by:zvonko
ID: 7203926
Don't do this Janette!!!

If he retires then it get pure work and no fun for me here :-)

(isn't this a declaration of love between Bro's :)

0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7203940
Okay If i reach 100k then I will retire.  Someday I will eventually reach that mark by either begging or stealing.

After that what ?  You can delay this but cannot stop the process.

But I can cut a deal with you. If you give me the 2000 pt then I may consider staying back at EE with you with usual fun stuff what do you say ?

Do you say our love costs only 500*4 ???  Lets live the way as it is okay ?

LOL!
-Arun.
0
 

Author Comment

by:jk9783
ID: 7204118
Well...a 500 pt question at an A had better involve you spending your vacation time in the cube next to me. I have a few projects I could definitely pass your time with. : )

Don't fret, I'm familiar enough with the workings of EE to understand the humor and banter that happens in serious questions.

Thanks again for your help! and the entertainment!
0
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7204277
Hi Janette !

Did you know we guys have a mailing list and discuss in that list like crazee ???

We are always fun loving guys!

Take Care!
Arun.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

  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…
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…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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