#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    23
    Rep Power
    0

    Delete only alphabetic in textbox


    i create 4 text box who name is
    Text1 Text2 Text3 Text4
    and i put this number and alphabetic chr all text box.
    When i run program show this different text box

    1. Text1 Show result ( Only Number )
    2. Text2 Show result ( only first Eight(8) number show )
    3. text3 Show result ( Type this 12-343-3567 )
    4. text4 Show result ( Only type first two(2) number )

    Private Sub Form_Load()
    testshow = "1234htu33?567"

    End Sub
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    289
    Rep Power
    45
    Code:
    Private Sub Form_Load()
        Dim txt As String
        Dim N%
        txt = "1234htu33?567"
        Debug.Print txt
        For N% = 1 To Len(txt)
            If Not IsNumeric(Mid$(txt, N%, 1)) Then
                Mid$(txt, N%, 1) = " "
            End If
        Next N%
        Debug.Print txt
        txt = Replace(txt, " ", "")
        Debug.Print txt
        Text1.Text = txt
        Text2.Text = Left$(txt, 8)
        Text3.Text = Left$(txt, 2) & "-" & Mid$(txt, 3, 3) & "-" & Mid$(txt, 6)
        Text4.Text = Left$(txt, 2)
    End Sub
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    23
    Rep Power
    0
    Thanks
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2011
    Posts
    23
    Rep Power
    0
    Thanks this is good work

IMN logo majestic logo threadwatch logo seochat tools logo