Re: Trimming a telephone number....Or replacing



buckpeace wrote:

I need to either trim or replace this number: (386)851-0090
to look like: 3868510090 (no dashes or ())


If that the only cases you have to deal with:

Replace(Replace(Replace(phone, "(", ""), ")", ""), "-", "")

If it gets much more complicated than that, you should
probably create a function to keep only digits:

Public Function ExtractDigits(s)
Dim k As Integer
If IsNull(s) Then Exit Function
For k = 1 to Len(s)
If Mid(s, k, 1) Like "#" Then
ExtractDigits = ExtractDigits & Mid(s, k, 1)
End If
Next k
End Function

--
Marsh
MVP [MS Access]
.