[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


reverse a string

Posted on 2005-05-13
Medium Priority
Last Modified: 2008-03-03

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.

Question by:JakeB52
  • 2
LVL 13

Expert Comment

ID: 13994972
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 :)
LVL 13

Accepted Solution

softplus earned 500 total points
ID: 13994980
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?)

Expert Comment

ID: 13995260
Use this new function StrReverse().

Featured Post

Transaction-level recovery for Oracle database

Veeam Explore for Oracle delivers low RTOs and RPOs with agentless transaction log backup and transaction-level recovery of Oracle databases. You can restore the database to a precise point in time, even to a specific transaction.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question