The Instr function returns the position of the first occurrence of a string in another string.

The syntax for the Instr function is:

Instr ([ start ], string_being_searched , string2 , [ compare ] )

start is optional. It is the starting position for the search. If this parameter is omitted, the search will begin at position 1.

string_being_searched is the string that will be searched.

string2 is the string to search for.

compare is optional. This is the type of comparison to perform. The valid choices are: vbUseCompareOption, vbBinaryCompare, vbTextCompare, and vbDatabaseCompare.

For example:

Instr (1, “Oracle Home “, “Home”) would return 8.

Instr (“Oracle Home “, “Home”) would return 8.

Instr (10, “Oracle Home “, “e”) would return 11.

Instr – Access Function
Tagged on: