Results 1 to 2 of 2

Thread: An Undo button. Help?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2014
    Posts
    21

    Exclamation An Undo button. Help?

    Hey VBForums.

    I have a few buttons that connect to text boxes. When these buttons are pressed the number in the text boxes increase.

    What code would I type in a separate Buttons sub to make it Undo the last button pressed?

    *Presses the +1 button for TextBox1*
    Amount on TextBox1 increases.
    *Presses Undo button*
    Last amount entered on TextBox1 is undone. -1
    *Presses the +3 button for TextBox1*
    Amount on TextBox1 increses.
    Last amount entered on TextBox1 is undone. -3

    How do I make this happen? What's the magic code

    Thanks.

  2. #2
    Fanatic Member
    Join Date
    Dec 2007
    Location
    West Yorkshire, UK
    Posts
    791

    Re: An Undo button. Help?

    I've already answered this question in this post. You do not subtract one, you save the value before you change it, then on "undo" you set the value of the textbox to the saved value.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width