subtract from field

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • didacticone
    Contributor
    • Oct 2008
    • 266

    subtract from field

    i have a form that shows text boxes with different values, and i would like when a button is clicked for '1' to be subtracted from the total of one of those text boxes.... thanks for your help
  • missinglinq
    Recognized Expert Specialist
    • Nov 2006
    • 3533

    #2
    What do you want to happen if the textbox is empty or Null when the button is clicked?

    And if the textbox is at 0 (zero) when the button is clicked, do you want to go into negative numbers?

    Linq ;0)>

    Comment

    • didacticone
      Contributor
      • Oct 2008
      • 266

      #3
      the textbox will not be null at least i would have no reason for it to be... it would just be at 0 and yeah negative numbers would be good... thanks

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32656

        #4
        As you share no details I will have to invent names for you. You can update it to match your own names I expect :
        Code:
        Private Sub cmdSubtract
            Me.ATextBox = Nz(Me.ATextBox, 0) - 1
        End Sub

        Comment

        • didacticone
          Contributor
          • Oct 2008
          • 266

          #5
          ok great yeah i think that should work, ill try it out and let you know... thanks!

          Comment

          Working...