MS Access: StrReverse Function
This MSAccess tutorial explains how to use the Access StrReverse function with syntax and examples.
Description
The Microsoft Access StrReverse function returns a string whose characters are in reverse order.
Syntax
The syntax for the StrReverse function in MS Access is:
StrReverse ( text )
Parameters or Arguments
- text
- The string whose characters you wish to reverse.
Applies To
The StrReverse function can be used in the following versions of Microsoft Access:
- Access 2019, Access 2016, Access 2013, Access 2010, Access 2007, Access 2003, Access XP, Access 2000
Example
Let's look at how to use the StrReverse function in MS Access:
StrReverse ("Tech on the Net") Result: "teN eht no hceT" StrReverse ("Alphabet") Result: "tebahplA" StrReverse ("abc123") Result: "321cba"
Example in VBA Code
The StrReverse function can be used in VBA code in Microsoft Access.
For example:
Dim LResult As String LResult = StrReverse ("techonthenet.com")
In this example, the variable called LResult would now contain the value "moc.tenehtnohcet".
Example in SQL/Queries
You can also use the StrReverse function in a query in Microsoft Access.
For example:
In this query, we have used the StrReverse function as follows:
Expr1: StrReverse([CustomerID])
This query will reverse the characters in the CustomerID field display the results in a column called Expr1. You can replace Expr1 with a column name that is more meaningful.
For example:
ReverseID: StrReverse([CustomerID])
The results would now be displayed in a column called ReverseID.
Advertisements