Good Afternoon,
I am looking for a way to have formatting applied to a phone number after the
number is updated. Data entry wants to be able to just type in the format of
5555555555 so they can go through it faster, is there a way to have it
formatted after the information is typed/input?
As further example:
Data Entry Wants to Type: 5555555555 (no input mask)
I need to have it formatted as (555) 555-5555
Any thoughts? Thanks.
Angus - 27 Sep 2006 22:19 GMT
Do something like this and attach it to the AfterUpdate event of the control:
Private Sub MyControl_AfterUpdate()
Dim MyString As String
MyString = MyControl
MyString = "(" & Left(MyString, 3) & ") " & Left(Right(MyString, 7), 3) &
"-" & Right(MyString, 4)
MyControl = MyString
End Sub
You will need to add some error trapping.
> Good Afternoon,
>
[quoted text clipped - 8 lines]
>
> Any thoughts? Thanks.
Marshall Barton - 27 Sep 2006 22:20 GMT
>Good Afternoon,
>
[quoted text clipped - 6 lines]
>Data Entry Wants to Type: 5555555555 (no input mask)
>I need to have it formatted as (555) 555-5555
As long as they always enterit that way, you can just set
the text box's Format property to a custom format:
\(@@@\) @@@\-@@@@

Signature
Marsh
MVP [MS Access]