Making numbers negitive

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to formant a textbox to make a number a negitive amout?
Wondering if there is some code or a simpler way to do that. Any
suggetions?

Thanks....
 
=[SomeField]*-1
Rick,
That will work unless the OP has some records where the values are already
negative. This might work better:

=IIF([SomeField] < 0, [SomeField], [SomeField] * -1)

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html



Rick B said:
=[SomeField]*-1

--
Rick B



Rick said:
Is there a way to formant a textbox to make a number a negitive amout?
Wondering if there is some code or a simpler way to do that. Any
suggetions?

Thanks....
 
Ahhhhh. Very good point!!!

That's why you are the MVP!

--
Rick B



Lynn Trapp said:
=[SomeField]*-1

Rick,
That will work unless the OP has some records where the values are already
negative. This might work better:

=IIF([SomeField] < 0, [SomeField], [SomeField] * -1)

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm
Jeff Conrad's Access Junkie List:
http://home.bendbroadband.com/conradsystems/accessjunkie.html



Rick B said:
=[SomeField]*-1

--
Rick B



Rick said:
Is there a way to formant a textbox to make a number a negitive amout?
Wondering if there is some code or a simpler way to do that. Any
suggetions?

Thanks....
 
Is there a way to formant a textbox to make a number a negitive amout?
Wondering if there is some code or a simpler way to do that. Any
suggetions?

Thanks....

Your message is not really clear.
A control's Format only effects what is displayed, not the control's
actual value.
Set the Format property of the control to:
-#;-#;0

Or.. do you mean you want to have every number entered into the
control actually become a negative value?
I so, code the control's AfterUpdate event:
If Me![ControlName]>0 Then
Me![ControlName]= Me![ControlName]*-1
End If

If you meant something else, I suggest you re-post with more
information.
 
One last suggestion:

Abs([SomeField]) * -1
in case it already was a negative number.

Brian
 
Back
Top