Results 1 to 6 of 6

Thread: PLEASE HELP! how can i know if a piece of text is a number or just a letter?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    95
    hey,

    how can I know if a piece of text is a number or a letter?

    thanks in advance!

  2. #2
    Guest
    Try ISNUM.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jul 2002
    Posts
    95

    IT DOESN'T WORK

    there isn't such function "isnum".

  4. #4
    Junior Member
    Join Date
    Apr 2000
    Posts
    24

    Hmm...

    Methinks VB is 'IsInt' or 'IsDigit'...Something along those lines...

    Strings are 'IsAlpha' I think too...

  5. #5
    Junior Member
    Join Date
    Apr 2000
    Posts
    24

    Ok...

    Looked it up in that 580some megs of MSDN and to check if its a number you do:

    If IsNumeric(BlaBlaBla) = True then

    ' etc.

    end if

    Letters are:

    If IsAlpha(Variable) = True then

    ' etc.

    end if

  6. #6
    Junior Member
    Join Date
    Mar 2000
    Posts
    16

    hopefully this helps

    Okay - if you have a text box say it's name is txtText, and you want to validate the text within that text box to make sure it's numerical, you would type

    IsNumeric(txtText.text)

    Usually you would use this in an if then statement such as

    If IsNumeric(txtText.text) = False (meaning not a number) then

    .....

    else (if it is numeric)
    ......
    If you need more help - email me at [email protected]

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