InstrRev error

S

Steve S

When I run the following query on one pc I get the expected results.

SELECT [TblC].[Name], InstrRev([Name]," ") AS [Length of Last Name]
FROM TblC;

But when I run the very same query on another pc I get the error:
Undefined function “InstrRev†in expression.

Both pcs are running Access 2000 (9.0.6926 SP-3)

What am I missing here
 
M

Michel Walsh

The second PC may have a MISSING reference. From the menu (in VBE), Tools |
References... see if a checked reference starts its description with the
word MISSING. If so, try to uncheck it, or install the required ddl
correctly on that PC.


Vanderghast, Access MVP
 
S

Steve S

thanks for the quick reply Michel,

None of the references show as missing. I should have mentioned in the
original post that I had already checked for missing references. I checked
again and nothing shows as 'Missing'
--
Steve S


Michel Walsh said:
The second PC may have a MISSING reference. From the menu (in VBE), Tools |
References... see if a checked reference starts its description with the
word MISSING. If so, try to uncheck it, or install the required ddl
correctly on that PC.


Vanderghast, Access MVP



Steve S said:
When I run the following query on one pc I get the expected results.

SELECT [TblC].[Name], InstrRev([Name]," ") AS [Length of Last Name]
FROM TblC;

But when I run the very same query on another pc I get the error:
Undefined function "InstrRev" in expression.

Both pcs are running Access 2000 (9.0.6926 SP-3)

What am I missing here
 
D

david

The second PC may not have macro security set up the same way.

The second PC may not have service packs installed the same way.

Those are the official reasons, but I decided that it was unreliable,
and I when back to using a User Defined function for InstrRev.

InstrRev was a VB function that was only added to Access VBA
in Access 2000.

There was a list of VBA functions that the query environment
recognises. Unfortunately, the new function InstrRev was left
off of the list, and didn't work in Access 2000 queries.

Fortunately, it was added to the list later.

Later, there was a list of safe expressions that you can use in a query.
Unless you allow unsafe expressions, you can't use unsafe expressions.

Unfortunately InstrRev seemed to have an indeterminate status after
the 'safe expression' list came out, and worked on some machines
and not on others.

You can try to track down this problem, but I wouldn't bother:
you'll have to check it again on every PC you ever use.

Don't use InstrRev in a query. Use a user defined function.

(david)
 
S

Steve S

thanks much David

the function

Public Function fcnBackwards(strName As String, StrChar As String) As Byte
fcnBackwards = InStrRev(strName, StrChar, , vbTextCompare)
End Function

Worked great
--
Steve S


david said:
The second PC may not have macro security set up the same way.

The second PC may not have service packs installed the same way.

Those are the official reasons, but I decided that it was unreliable,
and I when back to using a User Defined function for InstrRev.

InstrRev was a VB function that was only added to Access VBA
in Access 2000.

There was a list of VBA functions that the query environment
recognises. Unfortunately, the new function InstrRev was left
off of the list, and didn't work in Access 2000 queries.

Fortunately, it was added to the list later.

Later, there was a list of safe expressions that you can use in a query.
Unless you allow unsafe expressions, you can't use unsafe expressions.

Unfortunately InstrRev seemed to have an indeterminate status after
the 'safe expression' list came out, and worked on some machines
and not on others.

You can try to track down this problem, but I wouldn't bother:
you'll have to check it again on every PC you ever use.

Don't use InstrRev in a query. Use a user defined function.

(david)





Steve S said:
When I run the following query on one pc I get the expected results.

SELECT [TblC].[Name], InstrRev([Name]," ") AS [Length of Last Name]
FROM TblC;

But when I run the very same query on another pc I get the error:
Undefined function "InstrRev" in expression.

Both pcs are running Access 2000 (9.0.6926 SP-3)

What am I missing here
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top