[AccessD] UDF in Access called to Excel

Darryl Collins darryl at whittleconsulting.com.au
Tue Dec 13 20:52:10 CST 2011


Hi guys and girls.

One of my colleagues is using a UDF embedded into an Access Query.  The query runs find in access by when he is calling the query from Excel VBA (via qd.openrecordset).  The code fails with a 'undefined function' error.

I read on google the following which was a response to a similar issue:

"Access uses Jet, and the combination of Access and Jet understands VBA functions. DAO is a generic data access layer that doesn't understand VBA functions.
When you use DAO, you're not automating Access, merely using that bridge to get to the data.
Even though some versions of Access use DAO internally to communicate with Jet, the ability to understand VBA is programmed into Access, not DAO."

So, is that correct.  I would have thought the DOA would have only sent the command to open the query and Access would still do all of the processing?

Any thoughts on this.

I personally wouldn't do it this way. I would use the Function from Excel to get all of the parameters first and then pass them to the query as needed.  In this case the function is built into the query itself in Access.

Cheers
Darryl.



Darryl Collins
Whittle Consulting Pty Ltd
Suite 8, 660 Canterbury Rd
Surrey Hills, VIC, 3127

p: +61 3 9898 3242
m: +61 418 381 548
f: +61 3 9898 1855
e: darryl at whittleconsulting.com.au<mailto:darryl at whittleconsulting.com.au>
w: www.whittleconsulting.com.au<http://www.whittleconsulting.com.au/>




More information about the AccessD mailing list