Remove "hypens"

  • Thread starter Thread starter Ang
  • Start date Start date
A

Ang

Hi,

I'm using MS Access 97 and I have 5,000 records. I am trying to clean up
one column that has "hypens" but not all of them. I am tired to delete
hypens for clean up.

example:

E98-09-1293 should be E98091293

Your help would be appreciated.

Thanks
Ang
 
you could try this as an update qry for the items in question, by copying to
a module.

Public Function fNoDash(pn As Variant) As Variant
'================================================
'removes "-" from a string of characters, change string for other expression
eliminations
'see fnodasha for multi string removal
'use various vendor files for appending to rs6000.
'bdo 20020617
'================================================
Dim temp As String
Dim length As Integer
Dim i As Integer

If IsEmpty(pn) Then
fNoDash = pn
Exit Function
End If

temp = pn
length = Len(pn)


For i = length To 1 Step -1
If Mid(pn, i, 1) = "-" Then
temp = Left(temp, i - 1) & Right(temp, (length - i))
length = length - 1
End If
Next i
fNoDash = temp

End Function
 
Back
Top