Remove "hypens"

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
 
B

brad

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top