InStrRev

bobfin

Registered User.
Local time
Today, 00:26
Joined
Mar 29, 2002
Messages
82
I tried using the built-in function InStrRev in a query. Even though this function is documented in the VBA help system, I get an "undefined function" error message when I run the query. I'm using Access 2000 and my references are VBA, Access 9.0 Object Library, OLE Automation, MS ActiveX Data Objects 2.7 Library, and MS DAO 3.6 Object Library. How can I get Access to recognize this function?
 
How are you trying to use it in your query and what result are you trying to acheive?
You may have to 'wrap' it in a custom function to do what you want it to do and call the custom function from access.
 
I susspect the problem is one i have come accross many of time useing ;

Code:
InStr([start, ]string1, string2[, compare])

and

Code:
Replace(expression, find, replace[, start[, count[, compare]]])

Its simple and easy to fix, although the compare property is optional it isnt, this causes your crash.

Code:
InstrRev(stringcheck, stringmatch[, start[, compare]])

Just set the compare to vbBinaryCompare and your code sould start working.



:cool:ShadeZ:cool:
 
Shadez said:
I susspect the problem is one i have come accross many of time useing ;

Code:
InStr([start, ]string1, string2[, compare])

and

Code:
Replace(expression, find, replace[, start[, count[, compare]]])

Its simple and easy to fix, although the compare property is optional it isnt, this causes your crash.

Code:
InstrRev(stringcheck, stringmatch[, start[, compare]])

Just set the compare to vbBinaryCompare and your code sould start working.

Reply: My PC doesn't display a Reply icon, so I'm using a quote to reply. Knowledge Base article # 225956 says that the InStrRev function is one of 8 builtin functions that cannot be used in expressions. They can only be used in VBA code. So that's what I'll do.

:cool:ShadeZ:cool:
 

Users who are viewing this thread

Back
Top Bottom