Sabtu, 05 Mei 2018

[MS_AccessPros] Re: How to remove letters from strings with code?

 

Hi Kevin


A function like this should do the trick:

Public Function KeepOnlyNumeric( strIn as String ) As String
Dim strOut As String
Dim ch as String
Dim i as Integer
    For i = 1 to Len(strIn)
        ch = Mid(strIn, i, 1)
        Select Case ch
            Case "0" To "9"
                strOut = strOut & ch
        End Select
    Next i
    KeepOnlyNumeric = strOut
End Function

Warmly,
Graham

---In MS_Access_Professionals@yahoogroups.com, <qingqinga@...> wrote :

Dear All,
How to remove letters from strings with code, only keep the numbers? For example:

H2562 to 2562

Thanks in advance.

Best Regards,
Kevin

__._,_.___

Posted by: graham@mandeno.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar