Results 1 to 3 of 3

Thread: [RESOLVED] Help with this conditional statement

  1. #1

    Thread Starter
    Junior Member DanielT's Avatar
    Join Date
    Apr 2011
    Location
    Philippines
    Posts
    16

    Resolved [RESOLVED] Help with this conditional statement

    Hello, Help! Got stocked in this...


    The textbox must only accepts number so i write this code

    Private Sub cmdOK_Change()
    If Not IsNumeric(txtnum.Text) Then
    MsgBox ("Input a valid number.")
    End If
    End Sub

    _______________________________________________________

    But the problem is how could I make the txtnum only accepts
    10 digit number's and it will check whether it is number or not.
    If it is less than 10 then it will not be accepted.

    Let's try putting the code only in the cmdOK


    I hope you understand and sorry for my bad english...
    Thanks!!!
    Last edited by DanielT; May 16th, 2011 at 05:33 AM.

  2. #2
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,127

    Re: Help with this conditional statement

    You could use the LEN function:

    Code:
    If LEN(txtnum.text) < 10 Then
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  3. #3

    Thread Starter
    Junior Member DanielT's Avatar
    Join Date
    Apr 2011
    Location
    Philippines
    Posts
    16

    Re: Help with this conditional statement

    Hey dee-u thanks for your reply.

    Oh yea why did I forgot this one, it should work now thanks a lot!!!

Tags for this Thread

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