Reversing data

Judy

Registered User.
Local time
Today, 02:57
Joined
Sep 26, 2000
Messages
34
If I have a text field that holds 5 numbers (12345) is there a function in Access 97 or a way to reverse the order of the data (54321)?

Thanks!
 
Function ReverseString(linea As String) As String
'This procedure produces a reversal of
'an inputted string.

Dim result As String, i As Integer, n As Integer

n = Len(linea)
result = ""
For i = n To 1 Step -1
result = result & Mid(linea, i, 1)
Next i
ReverseString = result
Debug.Print linea & " reversed = " & result

End Function
 
So simple and it works great! Thanks so much for the help!
 

Users who are viewing this thread

Back
Top Bottom