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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simple Total Problem

Status
Not open for further replies.

wdverner

Technical User
Mar 10, 2005
160
GB
Hi All,
Just a quick one... im trying to total the contents of 2 text boxes on a form, however one has a negative value..

box 1= 21
box 2= -1

21 + (-1)= 22

But my form gives me back 20.......

What am I dong wrong?!
 
Hi!

Nothing, 21 + (-1) is 20. If you want to get 22 out of this you need to use the Abs function. 21 + Abs(-1) = 22

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
K ive used the ABS Function. I created a hidden field, which takes the value input and performs the ABS func on it. I then use THIS field in my expression calculation.

ABS essentially takes a number and converts it to a positive.
 
Darn i meant to have the formula as subtract the negative number.... 21 - (-1)=22..Thanks anyway
 
3 text boxes. Name them txt1, txt2, txt3

The control source of txt3 = [txt1] - [txt2]
Hope this helps
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top