Here is a function that you could call in your query and a small test routine to show function result.
Code:
Public Function FormatPhone(PhoneIn As String) As String
Dim HoldPhonein As String
10 On Error GoTo FormatPhone_Error
20 HoldPhonein = PhoneIn
30 If Len(Trim(PhoneIn)) > 0 Then
40 If (InStr(PhoneIn, "(")) > 0 Then
50 PhoneIn = Replace(PhoneIn, "(", "")
60 PhoneIn = Replace(PhoneIn, ") ", "-")
70 End If
80 End If
90 FormatPhone = PhoneIn
100 On Error GoTo 0
110 Exit Function
FormatPhone_Error:
120 MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure FormatPhone of Module AWF_Related"
End Function
Test routine
Code:
Sub testFormatPhone()
Dim a(2) As String, i As Integer
a(0) = "(204) 456-7489"
a(1) = "209-345-2345"
a(2) = "(278) 789-5432"
For i = 0 To UBound(a)
Debug.Print "Input to function " & a(i)
Debug.Print vbTab & "result of function " & FormatPhone(a(i))
Next i
End Sub
OOoops: I see ranman posted while I was testing.