hi all,
im using a phone format as 111-111-1111. But during run time, if the
user changes that as 1123-1133-222222 this i don't want. I want to keep
the format fixed as 111-111-1111. If user is changing that then the "-"
sign is getting appended one after the another.
my code is:
Private Sub txtPhone_Change()
If Len(txtPhone.Text) = 4 Then
txtPhone.SelStart = 5
ElseIf Len(txtPhone.Text) = 3 Then
txtPhone.Text = txtPhone.Text + "-"
txtPhone.SelStart = 5
ElseIf Len(txtPhone.Text) = 7 Then
txtPhone.Text = txtPhone.Text + "-"
txtPhone.SelStart = 9
End If
End Sub
please help to modify this code
Archived from group: microsoft>public>vb>enterprise