Please!! Help!! (textbox that accept Only Phone Number!)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabaladesign
    New Member
    • Mar 2008
    • 2

    #1

    Please!! Help!! (textbox that accept Only Phone Number!)

    hello guys.. please help me i made a program for my thesis and i need a
    textbox which will only accept telephone number like this format
    (954)-854-2452 .. please... please help me guys i really dont know what the code is.. thank you thank you in advance..
  • lee123
    Contributor
    • Feb 2007
    • 556

    #2
    hi there i believe there in the propeties for the text box there is a property called data format in there you can choose a setting for you phone number and format it the way you'll like to see it if you choose custom.

    lee123

    Comment

    • pureenhanoi
      New Member
      • Mar 2007
      • 175

      #3
      Originally posted by zabaladesign
      hello guys.. please help me i made a program for my thesis and i need a
      textbox which will only accept telephone number like this format
      (954)-854-2452 .. please... please help me guys i really dont know what the code is.. thank you thank you in advance..
      Use masked textbox instead of origine textbox

      Comment

      • janders468
        Recognized Expert New Member
        • Mar 2008
        • 112

        #4
        If you are looking to validate this in code, then you could use something like this:

        Code:
        If (TextBox Value) like "(###)-###-####" then
            'accept result
        else
            'do something else
        end if
        The "#" insure that a number is entered and the rest verifies the format.

        Comment

        Working...