Undefined Function Error on custom function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using Acc97, and have written my own function "IsInStr", to find out if a
particular character is in a given string, and return the location in the
string of the first instance of the character

I've used this function in an update query and have no problem executing the
query manually. HOWEVER, when I switched over to my VBA module to execute
the query via code - I get "Undefined Function "IsInStr" in expression".

Here's the quandry - I've copied both query and function from another
database where they DID work. I know the query executes properly in the new
environment, because I ran it manually and it did what I wanted.

WHY am I getting this error in the new database and not the old one? All my
references are working - none missing, none unchecked that should be ...
nothing's out of place that I can find - and yet I get this error both when
executing a query using this function, and when opening a recordset using
this function.

Any ideas out there?

-Amanda
 
Murphey's Law Strikes Again!

I was a bit impatient - and didn't shutdown Access between adding and
removing a new library in References.

Once I added a library, closed Access, Opened Access, and removed the
library - everything works now.

Go figure! (Same machine for design and execute - just different DB - and
it goes nuts ANYWAY!)


-Amanda

Computers are like children - they take everything literally and won't take
out the trash without telling them twice.
 
Can you show us the exact code that is failing (including a few lines
before and after)?

I'm using Acc97, and have written my own function "IsInStr", to find out if a
particular character is in a given string, and return the location in the
string of the first instance of the character

I've used this function in an update query and have no problem executing the
query manually. HOWEVER, when I switched over to my VBA module to execute
the query via code - I get "Undefined Function "IsInStr" in expression".

Here's the quandry - I've copied both query and function from another
database where they DID work. I know the query executes properly in the new
environment, because I ran it manually and it did what I wanted.

WHY am I getting this error in the new database and not the old one? All my
references are working - none missing, none unchecked that should be ...
nothing's out of place that I can find - and yet I get this error both when
executing a query using this function, and when opening a recordset using
this function.

Any ideas out there?

-Amanda


Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
I am curious as to why you wrote an function that already exists in VBA.
Unless I am missing something, your description describes the Instr function.
 
Back
Top