Results 1 to 5 of 5

Thread: [RESOLVED] Need to find the DATA TYPE of a given input

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    110

    Resolved [RESOLVED] Need to find the DATA TYPE of a given input

    Can anyone please tell me how can I find the data-type from a text field (value entered by the user)?


    This will be a great help

    Thanks

  2. #2
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Need to find the DATA TYPE of a given input

    Would this do:
    VB Code:
    1. If IsNumeric(Text1.Text) Then
    2.     Debug.Print "is numerical"
    3. Else
    4.     Debug.Print "is text"
    5. End If
    ?

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Nov 2006
    Posts
    110

    Re: Need to find the DATA TYPE of a given input

    Thank you so much gavio

    This should get my problem solved ... i'm gonna try it right now

  4. #4
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Need to find the DATA TYPE of a given input

    Or:
    VB Code:
    1. If IsNumeric(Text1.Text) Then
    2.     If InStr(1, Text1.Text, ".") Or InStr(1, Text1.Text, ",") Then ', or . - depends on your local settings
    3.         Debug.Print "is floating-point numerical value"
    4.     Else
    5.         Debug.Print "is fixed-point numerical value"
    6.     End If
    7. Else
    8.     Debug.Print "is text"
    9. End If

  5. #5
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: Need to find the DATA TYPE of a given input

    Quote Originally Posted by getusama
    Thank you so much gavio...
    You're welcome

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