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

Negative Values in MS Access

Status
Not open for further replies.

jpiscit1

Technical User
Oct 9, 2002
44
0
0
US
Can anyone tell me why my negative values knock off a decimal when I perform the same exact calculation on a postive value?

Here's what I have:

A form with 5 text boxes.
Text box (TextWeightPickup) represents a net (delta) value of weight in kg. - text box is linked to SQL table
Text box (TextUSLKg) represents USL (upper spec Limit) in kg. - text box is linked to SQL table
Text box (TextLSLKg) represents LSL (Lower spec Limit) in kg. - text box is linked to SQL table
Text box (TextUSL) represents USL (Upper spec Limit) in %. - text box is NOT linked to SQL table - Enabled property = NO
Text box (TextLSL) represents LSL (Lower spec Limit) in %. - text box is NOT linked to SQL table - Enabled property = NO

The user would enter in a value for TextWeightPickup. He/She would then entire in a value for the TextUSLKg and the TextLSLKg. here would be an example of what is entered:

TextWeightPickup = 0.783
TextUSLKg = .030
TextLSLKg = -.030 Note: negative value representing lower specification limit.

Here my problem:
I am running a calculation on the boxes TextUSL and TextLSL that would display the kg USL/LSL in terms of percent. But no matter what I do the calculation for the negative keeps knocking of a decimal place. Here is the calculation I am using:

=([TextUSLKg]/[TextWeightPickup])*100

You would assume (.030/0.783)*100 = 3.83%
and (-.030/0.783)*100 = -3.83%

But I am getting:
USL (+) 3.83
LSL (-) 3.8

If the calculation product was 3.86 the value in LSL would be 3.9 which implies it is rounding.

Now, I have already verified that the related SQL fields are formated properly and that the Text box Format is not on Auto (does the same thing when it is on) and instead set for 2. Although I have tried 3, 4, 5, etc.

What might be going on here? Does MS Access have a problem with Negative values ????

Thanks in Advance.

John


Your limits are only as far as you set your boundries......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top