VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



format phone number

by Jayan Mavelikara (2 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 30th July 2004
Date Added: Mon 8th February 2021
Rating: (1 Votes)

format phone number

Rate format phone number



    'in the button click event put this code.
    Text1.Text = "8002622823"   ' format it like (800)262-2823
    
    Dim temp1 As String
      
     temp1 = "("
     temp1 = temp1 & Left(Text1.Text, 3)
     temp1 = temp1 & ")"
     temp1 = temp1 & Mid(Text1.Text, 4, 3)
     temp1 = temp1 & "-"
     temp1 = temp1 & Right(Text1.Text, 4)
     Text2.Text = temp1   'display the result

Download this snippet    Add to My Saved Code

format phone number Comments

No comments have been posted about format phone number. Why not be the first to post a comment about format phone number.

Post your comment

Subject:
Message:
0/1000 characters