hi,
KPNum
--------
A1234
RF\3245
WEJ-123
Q: How to delete the alpha & character leaving only numbers?
Where do you get such bad data?
Aircode, place it in a standard module:
Public Function StripAlpha(AString As Variant) As Variant
Dim Count As Long
Dim Result As Variant
Dim Source As String
If IsNull(AString) Then
Result = Null
Else
Source = CStr(AString)
Result = ""
For Count = 1 To Len(Source)
Select Mid(Source, Count, 1)
Case 'A' To 'Z', 'a' To 'z'
Result = Result & Mid(Source, Count, 1)
End Select
Next Count
End If
StripAlpha = Result
End Sub
Use it in an update query: =StripAlpha([KPNum])
mfG
--> stefan <--