J
Joe Cilinceon
What built in function will change the sign of a number from + to -.
What built in function will change the sign of a number from + to -.
One more question for you guys. How is the best way to set a field in a
table so its values are always a negative number. Also if they are positive
how is the best way to change them to negative.
Klatuu said:I would not control that at the table level, Joe. I would do it at
the form level in the After Update event of the control where the
number is: Me.txtNegNumber = Abs(Me.txtNegNumber) * -1
The Abs function removes the sign bit from the number so that * -1
always turns it negative.
John said:1. Set a Validation Rule (in table design view) on the field of <0.
Set the validation text to "This number must be negative" or some
other suitable warning.
2. Create an Update query based on your table; select this field. Put
a criterion of
on the Criteria line, and
- [fieldname]
on the Update To line.
John W. Vinson[MVP]