Back Space textbox using Command_button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Wagsy
    New Member
    • Apr 2007
    • 14

    Back Space textbox using Command_button

    Hello Again,
    i have a virtual keypad 0-9, i can type in stuff

    text1.text = text1.text & "2"

    when i press a command button,

    how do i use the back space chr$08 to remove the last number entered?

    i.e. a delete button?
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Originally posted by Wagsy
    ... how do i use the back space chr$08 to remove the last number entered?
    i.e. a delete button?
    If it's definitely just the last digit, then simply remove the last character from the .Text property. For example...
    [CODE=vb]text1.Text = Left(text1.Text , Len(text1.Text) - 1)[/CODE]If you need to remove the last digit before the current insertion point (cursor) then it will be a bit more complex.

    Comment

    • Wagsy
      New Member
      • Apr 2007
      • 14

      #3
      thanks very much, i'll give it a whirl.

      Comment

      • Robbie
        New Member
        • Mar 2007
        • 180

        #4
        Originally posted by Killer42
        If you need to remove the last digit before the current insertion point (cursor) then it will be a bit more complex.
        Yep...

        [code=vb]
        text1.Text = Mid(text1.Text, 1, text1.SelStart-1) + Mid(text1.Text, text1.SelStart + 1)
        [/code]
        ;)

        Comment

        • Wagsy
          New Member
          • Apr 2007
          • 14

          #5
          Yep.... thanks for you time......

          Comment

          Working...