Salut
J'utilise cette fonction dans un module standard
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| Public Function fExtractNumeric(strInput) As String
'https://bytes.com/topic/access/answers/862765-extracting-number-string
' Returns the numeric characters within a string in
' sequence in which they are found within the string
Dim strResult As String, strCh As String
Dim intI As Integer
If Not IsNull(strInput) Then
For intI = 1 To Len(strInput)
strCh = Mid(strInput, intI, 1)
Select Case strCh
Case "0" To "9"
strResult = strResult & strCh
Case Else
End Select
Next intI
End If
fExtractNumeric = strResult
End Function |
Et à l'aide d'une requête
fExtractNumeric([MonChamp])
Partager