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!

converting a positive number to a negitive number

Status
Not open for further replies.

04061975

Programmer
Mar 19, 2003
8
AU
Would any one please be able to advise me if it is at all possible to convert a positive number into a negative number in a field?? For example 1 to -1. Is there an access function that can be used to convert this?
 
Just multiple the postitive number by -1. If you don't want a negative number conversely to be converted to positive then you should test for >0 before executing this expression.

IIF(Me![ControlName]>0, Me![ControlName]*-1, Me![ControlName])

This should do it for you.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 


Is there some reason you don't just multiply the original value by -1? If you only want to convert positive numbers than check it see if number is > 0 before making conversion. I

Michael
 
Hi Bob,

Thanks for the help with converting a positive to a negative number.

Nicolle
 
Glad to be of assistance.

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top