Convert #s To Negative

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

Guest

Hello All,
I am trying to set a control on a form to convert numbers typed into the
text box to a negative number and then store that number to the table. So far
I haven't been able to think of a way to do this. My hunch is that its easier
than I am making it. Thank you for any and all assistance. Oh, by the way, if
you could explain how to use and where to put any code offered that would be
greatly appreciated. I'm a novice in VBA.
Adam
 
Have you tried in the before update event of your text box
Me![TextboxName] = Me![TextboxName] * -1
 
Have you tried in the before update event of your text box
Me![TextboxName] = Me![TextboxName] * -1
 
I would find the absolute value, then multiply it by -1

I would put this in the before update event. Something like..

fieldname = Abs([fieldname])*-1
 
I would find the absolute value, then multiply it by -1

I would put this in the before update event. Something like..

fieldname = Abs([fieldname])*-1
 
This will work, unless the number is already entered as a negative. In
other words, if one enters -10, this would turn it into 10.


--
Rick B



schasteen said:
Have you tried in the before update event of your text box
Me![TextboxName] = Me![TextboxName] * -1

F1stman said:
Hello All,
I am trying to set a control on a form to convert numbers typed into the
text box to a negative number and then store that number to the table. So
far
I haven't been able to think of a way to do this. My hunch is that its
easier
than I am making it. Thank you for any and all assistance. Oh, by the
way, if
you could explain how to use and where to put any code offered that would
be
greatly appreciated. I'm a novice in VBA.
Adam
 
This will work, unless the number is already entered as a negative. In
other words, if one enters -10, this would turn it into 10.


--
Rick B



schasteen said:
Have you tried in the before update event of your text box
Me![TextboxName] = Me![TextboxName] * -1

F1stman said:
Hello All,
I am trying to set a control on a form to convert numbers typed into the
text box to a negative number and then store that number to the table. So
far
I haven't been able to think of a way to do this. My hunch is that its
easier
than I am making it. Thank you for any and all assistance. Oh, by the
way, if
you could explain how to use and where to put any code offered that would
be
greatly appreciated. I'm a novice in VBA.
Adam
 
Back
Top