Using the Sgn Function
In this tutorial you will learn how to use the SGN Function.
The SGN function returns a Variant (Integer) indicating the sign of a number.
=SGN( number )
number The required number argument can be any valid numeric expression
In this example we will use -3.
The result is -1.
|If number is||Sgn returns
|Greater than zero||1
|Equal to zero||0
|Less than zero||-1
The results using a Query would be
In a Form you could set the Default Value of a Textbox to
In a Form add a TEXTBOX control and rename it "txtSGN", then you could add the following in the Load Event.
Private Sub Form_Load()
txtSGN = SGN(-3)
Access Expert 26
You can find more about this by searching the website.
By: Alex Hedley
Click here to sign up for more FREE tips