Results 1 to 6 of 6
  1. #1
    TheProfessorIII is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2011
    Posts
    10

    Converting Positive to Negative

    Hi - what property do I need to set in order for a pos number to be changed to a neg # when entered. Example: User enters 10, once they tab off that field, it auto changes to a neg value.
    thanks

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    why don't you do this:
    Code:
    control_onblur()
    
    me.control.value = me.control.value - (me.control.value * 2)
    That'll work!!

  3. #3
    BenB is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2011
    Location
    London
    Posts
    3
    For a Form, you could use a VBA (AfterUpdate event) procedure to calculate the Textbox control to a negative number as a calculation.

    If your Textbox control is called TextBox1 then something like:
    TextBox1 = TextBox 1 * -1

    This works for either an Unbound/Bound control in a Form.
    Alternatively, you could create a calculation in another field or five an illusion of a negative value (when a positive value is entered) by formatting the field using -0 for the format property which can now be applied to a field in a table, query, form or report.

    Hope this helped.
    Ben Beitler
    Your Access Expert!

  4. #4
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    Quote Originally Posted by BenB View Post
    Your Access Expert!
    YOUR??

  5. #5
    BenB is offline Novice
    Windows Vista Access 2010 32bit
    Join Date
    Mar 2011
    Location
    London
    Posts
    3
    YOUR??
    ajetrumpet??

  6. #6
    Dinzdale40 is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    12
    you may also want to limit what can be put into the field...or make an if statement and only process the code above if the value is >0.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Summing Positive and Negative Currency
    By nweird in forum Reports
    Replies: 1
    Last Post: 07-22-2010, 10:05 AM
  2. Replies: 2
    Last Post: 01-13-2010, 05:29 AM
  3. Convert Negative Values to Positive
    By creativefusion in forum Queries
    Replies: 1
    Last Post: 10-21-2009, 02:47 AM
  4. Sum Of Positive Number and Negative Number
    By maysamab in forum Reports
    Replies: 1
    Last Post: 10-20-2008, 04:06 PM
  5. Matching positive with negative amounts
    By cwert11 in forum Access
    Replies: 1
    Last Post: 09-29-2008, 12:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums