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 / May 2008

Tip: Looking for answers? Try searching our database.

Formating strings

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
OldManEd - 26 May 2008 21:30 GMT
I have a module function that extracts one or more telephone numbers from
severasl records with a common ID. It is based on a query.

It loops thru a recordset using the ID and returns a string like:

2031234568
2031238654
2031236584

I have inserted a vbCrCf to break the string into separate lines.

I now want to format the telephone number in either of the following
standard formats:

(203) 123-4568   or   203 123-4568

How do I do this?
Albert D. Kallal - 26 May 2008 21:52 GMT
Use format command:

In the debug.window, I just tried:

debug.Print format("2031234568","(@@@) @@@-@@@@")
(203) 123-4568

note the output....

Signature

Albert D. Kallal    (Access MVP)
Edmonton, Alberta Canada
pleaseNOOSpamKallal@msn.com

 
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.