Results 1 to 4 of 4

Thread: Text values

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    158

    Text values

    If u have a txtbox where a user inputs a name u can use

    If txt1.text isnumeric then
    msgbox "that is not a valid name"
    end if

    But what is the command for text like alphanumeric is text and numbers but what is the one for just text

    it doesnt like the command Isalphanumeric

    thanks Trav

  2. #2
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    VB Code:
    1. Public Function IsAllString(str As String)
    2. Dim isit As Boolean
    3. isit = True
    4. For i = 1 To Len(str)
    5. If (Mid(str, i, 1) >= "A" And Mid(str, i, 1) <= "Z") Or (Mid(str, i, 1) >= "a" And Mid(str, i, 1) <= "z") Then
    6. isit = True
    7. Else
    8. isit = False
    9. Exit For
    10. End If
    11. Next
    12. IsAllString = isit
    13. End Function
    Last edited by abdul; Jun 14th, 2002 at 10:39 PM.
    Baaaaaaaaah

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2002
    Posts
    158
    thanks for ur help m8

  4. #4
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    No Problem. I just reread your post and noticed that you only want letters (no punctuations, numbers, etc), right? I just changed the code so that it only accepts letters "a" to "z" or "A' to "Z".
    Baaaaaaaaah

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