Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Convert #s To Negative

Discussion in 'Information Technology' started by F1stman, Jul 28, 2006.

  1. F1stman

    F1stman
    Expand Collapse
    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
     
  2. Loading...

    Similar Threads Forum Date
    Sikhconvert Joins Sikh Philosophy Network! New SPN'ers Aug 28, 2016
    Jehovah's Witnesses Are Out And Converting! Blogs Jul 31, 2016
    Islam Ishna Has Converted To Islam Interfaith Dialogues Apr 1, 2016
    A Christian Missionary tried to convert me. Blogs Oct 22, 2015
    "Convert's Corner" - Ideas for Retitle? Convert's Corner Oct 21, 2015

  3. schasteen

    schasteen
    Expand Collapse
    Guest

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

    "F1stman" wrote:

    > 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
     
  4. Rick B

    Rick B
    Expand Collapse
    Guest

    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

    --
    Rick B



    "F1stman" <F1stman@discussions.microsoft.com> wrote in message
    news:AA321CA5-A42D-4838-B763-34E2BE2EFDDA@microsoft.com...
    > 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
     
  5. Rick B

    Rick B
    Expand Collapse
    Guest

    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" <schasteen@discussions.microsoft.com> wrote in message
    news:E28CB6BB-0591-43B1-8B78-F416E68DBF58@microsoft.com...
    > Have you tried in the before update event of your text box
    > Me![TextboxName] = Me![TextboxName] * -1
    >
    > "F1stman" wrote:
    >
    >> 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
     

Share This Page