1. Home
  2. Computing & Technology
  3. Databases

Microsoft Access Function Library: InStrRev()

By , About.com Guide

Function: InStrRev()

Purpose: The InStr() function returns a number corresponding to the first location of a substring within a string, with the comparison beginning at the end of the searched string.

Usage: InStr(string, substring [,start] [,compare])

Start is an option argument specifying the location within the string to start searching. If you do not specify a starting location, Access uses the default value of -1, representing the last character of the string.
String is the string you wish to search within.
Substr is the substring you wish to locate within String.
Compare is an optional argument specifying the type of comparision you wish to use. The possible values are:
  • vbUseCompareOption uses the Option Compare statement’s setting. This is the default setting.
  • vbBinaryCompare uses a binary comparison.
  • vbTextCompare uses a textual comparison.


Returns: Starting position of the substring within the searched string. If string is empty, it returns 0. If string is null, it returns null. If substring is empty, it returns the start value. If substring is null, it returns null. If there is no match, it returns 0.

Example
InStr("chapple", "ppa") = 3
InStr("ppa", "chapple") = 0
InStr("","apple") = 0
InStr("apple","") = 1
InStr("apple",NULL) = NULL
InStr(NULL,"apple") = NULL
Explore Databases
About.com Special Features

The Best Web Trends of the Decade

A look back at the best innovations, ideas and technologies over the last 10 years, More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Databases
  4. Microsoft Access
  5. Access Function Library
  6. Microsoft Access Function Library: InStrRev()>

©2010 About.com, a part of The New York Times Company.

All rights reserved.