Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / September 2006

Tip: Looking for answers? Try searching our database.

Formatting after text is entered

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
steinmetzw42 - 27 Sep 2006 21:25 GMT
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]

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.