Convert #s To Negative

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
 
G

Guest

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

Guest

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

Rick B

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
 
R

Rick B

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
 
R

Rick B

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
 
R

Rick B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top