Formating strings

  • Thread starter Thread starter OldManEd
  • Start date Start date
O

OldManEd

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?
 
Use format command:

In the debug.window, I just tried:


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

note the output....
 
Back
Top