reverse a string

Is there any way to reverse a string similar to this "2000 2001 2004  " so it looks like "2004 2001 2000".

I have tried StrReverse (strYears) without any success.

Some important things to note:

1) The number of years may vary in a string
2) There will always be an undetermined number of spaces at the end of the string
3) I'm using Access 2000

Any help would be appreciated.

Who is Participating?
softplusConnect With a Mentor Commented:
oh, ok for your point 2, you might use instead:
sList = Split(trim(sInput), " ")

Do you need the spaces at the end of the resulting string as well? (probably not?)
dim sList$()
dim iCounter%
dim sDone$
sList = Split(sInput, " ")
for iCounter = ubound(sList) to lbound(sList) step -1
  sDone = sDone & " " & sList(iCounter)
sDone = Trim(sDone)

Done :)
boyinapalliBI DeveloperCommented:
Use this new function StrReverse().
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.