Functions in queries not working when called externally

  • Thread starter Thread starter DavidY
  • Start date Start date
D

DavidY

I have a 2002 Access database with a query that uses a function defined in
VBA. This query works fine when it's run from within the database, but if I
try to run the querydef from an outside program (in this case a VB automation
object) I get an error saying the function is undefined. Do I need to declare
the function somewhere in the external program that is trying to run the
querydef?
 
DavidY said:
I have a 2002 Access database with a query that uses a function
defined in VBA. This query works fine when it's run from within the
database, but if I try to run the querydef from an outside program
(in this case a VB automation object) I get an error saying the
function is undefined. Do I need to declare the function somewhere in
the external program that is trying to run the querydef?

VBA functions in queries only work when Access is executing the query. That
is because Access can use the Expression Service to evaluate those VBA
functions.

When executing from another program all you have is the Jet engine. Only
native Jet functions can be used in those contexts.
 
Ugh, I was afraid of that. I suppose there's no easy workaround for that?
Thanks for your reply.
 
Back
Top