Formatting after text is entered

  • Thread starter steinmetzw42 via AccessMonster.com
  • Start date
S

steinmetzw42 via AccessMonster.com

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.
 
G

Guest

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.
 
M

Marshall Barton

steinmetzw42 said:
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


As long as they always enterit that way, you can just set
the text box's Format property to a custom format:
\(@@@\) @@@\-@@@@
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top