Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

Returns the position of an occurrence of one string within another, from the end of string in an Access desktop database.

Syntax

InStrRev(stringcheck, stringmatch [, start[, compare]])

The InStrRev function syntax has these named arguments:

Argument

Description

stringcheck

Required. String expression being searched.

stringmatch

Required. String expression being searched for.

start

Optional. Numeric expression that sets the starting position for each search. If omitted, –1 is used, which means that the search begins at the last character position. If start contains Null, an error occurs.

compare

Optional. Numeric value indicating the kind of comparison to use when evaluating substrings. If omitted, a binary comparison is performed. See Settings section for values.

Settings

The compare argument settings are:

Constant

Value

Description

vbUseCompareOption

-1

Performs a comparison using the setting of the Option Compare statement.

vbBinaryCompare

0

Performs a binary comparison.

vbTextCompare

1

Performs a textual comparison.

vbDatabaseCompare

2

Microsoft Office Access 2007 only. Performs a comparison based on information in your database.

Return Values

If

InStrRev returns

stringcheck is zero-length

0

stringcheck is Null

Null

stringmatch is zero-length

start

stringmatch is Null

Null

stringmatch is not found

0

stringmatch is found within stringcheck

Position at which match is found

start > Len(stringmatch)

0

Remarks

Note that the syntax for the InStrRev function is not the same as the syntax for the InStr function.

Query examples

Expression

Results

SELECT Names_InstrRev.*, InStrRev(FullName,"S") AS Expr1 FROM [Names_InstrRev];

Returns the position of string "S" from the values in the column "FullName" from the table Names.

SELECT Names_InstrRev.*, InStrRev(FullName,"S",10) AS InStrTest FROM [Names_InstrRev];

Returns the position of string "S" from the values in the column "FullName", starting from position 10 from the table Names and displays in the column InStrTest.

String functions and how to use them

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×