Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox arithmetic

Status
Not open for further replies.

LenaS

Technical User
Nov 28, 2000
98
US
I have 3 textboxes on a form. The first (txt1) is displaying a variable (yOldAmt) which contains the calculated sum of several fields. The second (txt2) is a data entry box. The third (txt3) should display the result of txt1-txt2.
Here is basically the code I tried.

yNewAmt = $0.00

yNewAmt = yOldAmt – txt2.value

txt3.value = yNewAmt

thisform.refresh

I am getting an operator/operand mismatch error.
 
If Jim is correct, set the initial/default value of txt2.value = 0. Robert Bradley
teaser.jpg

 
I suggest you put in - ThisForm.Refresh

WITH THIS.
... any code needed to refresh txt1.Value
...
txt3.Value = txt1.Value - tx2.Value
EndWith
ramani :-9
(Subramanian.G)
FoxAcc
ramani_g@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top