Remove Numeric data

M

Mike Green

Hi All
I am taking the text string that the user enters and passing it to a field
in another form that is opened. How do I automatically detect and remove
the numeric part of the text string if the user enters it by mistake?
Any assistance will be appreciated.
Regards
Mike Green
 
R

Ricky Hicks MVP

Not sure what you are doing .. but here is a user defined function that will
loop through a string and remove all numeric characters ...

Public Function fRemoveNumeric(varEntry As Variant) As String
Dim strTmp As String
Dim x As Integer

If IsNull(varEntry) Then Exit Function

For x = 1 To Len(varEntry)
If Not IsNumeric(Mid(varEntry, x, 1)) Then strTmp = strTmp & Mid(varEntry,
x, 1)
Next x

fRemoveNumeric = strTmp

End Function

R. Hicks
 
Top