Telephone field help

torquay

Registered User.
Local time
Today, 21:14
Joined
Dec 27, 2005
Messages
85
Can anyone help me please.
I have a telephone field that has been imported from many different databases and the format is different in some cases and i need to have all of the fields the same as in 00000000000 in other words no spaces or brackets.
Some of the numbers are
(00000) 000000 or
(00000)000000 or
00000000000 or
00000 000000 and finally some are blank
I can't seem to get the code correct to achieve what I need.

Thanks
Kim
 
Put this function in a standard module named basFunctions
Code:
Function Clean(InString As String) As String
'-- Returns only the numbers from InString
Dim x As Integer
For x = 1 To Len(InString)
   If IsNumeric(Mid(InString, x, 1)) Then
      Clean = Clean & Mid(InString, x, 1)
   End If
Next x

End Function
Then you can use it in an Update query.
 
Last edited:
Perfect, worked a charm.

Thanks for the speedy reply
 

Users who are viewing this thread

Back
Top Bottom