Functions in queries not working when called externally

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?
 
R

Rick Brandt

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.
 
D

DavidY

Ugh, I was afraid of that. I suppose there's no easy workaround for that?
Thanks for your reply.
 

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

Top