Reverse String (1 Viewer)

Status
Not open for further replies.

boblarson

Smeghead
Local time
Today, 14:14
Joined
Jan 12, 2001
Messages
32,059
EDIT 04 Oct 2007: I just found out that Access 2000 and above has the strReverse function which does what this does. If you have Access 97 you do NOT have strReverse so this could help, if you have need of something like this.

Don't know if anyone will ever need something like this, but if you ever need to reverse a string, here's a function that will do it. I wrote it as a fun exercise.

Code:
Public Function ReverseWords(strWords As String) As String
    Dim strTemp As String
    Dim lngCount As Long
    lngCount = Len(strWords)
    Do Until lngCount = 0
        strTemp = strTemp & Mid(strWords, lngCount, 1)
        lngCount = lngCount - 1
    Loop
    ReverseWords = strTemp
End Function
 
Last edited:
Status
Not open for further replies.

Users who are viewing this thread

Top Bottom