By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,105 Members | 1,048 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,105 IT Pros & Developers. It's quick & easy.

negative

P: n/a
i have a field that holds currency formatted numbers. how would I make it so that all values entered in this field would be
negative?
thanks in advance
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
In the AfterUpdate event of the field, you could perhaps add something like:
Me.your_field.Value = Me.your_field.Value * -1

Mark

<jj****@earthlink.net> wrote in message
news:fL*****************@newsread3.news.pas.earthl ink.net...
i have a field that holds currency formatted numbers. how would I make it
so that all values entered in this field would be negative?
thanks in advance

Nov 13 '05 #2

P: n/a
This can be done in a form, but not in the table itself. mark gave a good
idea, but what if the user types it in as a negative to begin with. Modify
the equation slightly.

Me.your_field.Value = Abs(Me.your_field.Value) * -1

--
Wayne Morgan
Microsoft Access MVP
"Mark" <ma**********@ntlworld.com> wrote in message
news:4_**************@newsfe1-win.ntli.net...
In the AfterUpdate event of the field, you could perhaps add something
like: Me.your_field.Value = Me.your_field.Value * -1

Nov 13 '05 #3

P: n/a
Hi Wayne,
could you explain what the 'Abs' is doing?

Cheers,

Mark

"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:tR****************@newssvr33.news.prodigy.com ...
This can be done in a form, but not in the table itself. mark gave a good
idea, but what if the user types it in as a negative to begin with. Modify
the equation slightly.

Me.your_field.Value = Abs(Me.your_field.Value) * -1

--
Wayne Morgan
Microsoft Access MVP
"Mark" <ma**********@ntlworld.com> wrote in message
news:4_**************@newsfe1-win.ntli.net...
In the AfterUpdate event of the field, you could perhaps add something
like: Me.your_field.Value = Me.your_field.Value * -1


Nov 13 '05 #4

P: n/a
Certainly, the Abs() function is Absolute Value. If the user enters a
negative number (knowing that you're wanting a negative number), such as -2,
then (-2)*(-1) is 2, a positive number. However, the poster wants to always
store a negative value. The absolute value function will always give a
positive number (or zero, of course), so that when you multiply by -1, the
value will be negative.

Abs(-2) is 2
Abs(2) is 2
2*(-1) is -2

--
Wayne Morgan
Microsoft Access MVP
"Mark" <ma**********@ntlworld.com> wrote in message
news:7J***********@newsfe5-gui.ntli.net...
Hi Wayne,
could you explain what the 'Abs' is doing?

Nov 13 '05 #5

P: n/a
"Mark" <ma**********@ntlworld.com> wrote:
could you explain what the 'Abs' is doing?


'Absolute' value, ie 'unsigned'. This takes care of a negative value
entered by the user by taking the magnitude of the value only.

Regards,
Keith.
www.keithwilby.com
Nov 13 '05 #6

P: n/a
Cheers Wayne, a very in-depth and helpful reply.

Mark

"Wayne Morgan" <co***************************@hotmail.com> wrote in message
news:iE****************@newssvr33.news.prodigy.com ...
Certainly, the Abs() function is Absolute Value. If the user enters a
negative number (knowing that you're wanting a negative number), such
as -2, then (-2)*(-1) is 2, a positive number. However, the poster wants
to always store a negative value. The absolute value function will always
give a positive number (or zero, of course), so that when you multiply
by -1, the value will be negative.

Abs(-2) is 2
Abs(2) is 2
2*(-1) is -2

--
Wayne Morgan
Microsoft Access MVP
"Mark" <ma**********@ntlworld.com> wrote in message
news:7J***********@newsfe5-gui.ntli.net...
Hi Wayne,
could you explain what the 'Abs' is doing?


Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.