
DEV ASHISH - Bugs: Undefined Function in Expression (Error 3985)
It is possible but *more likely*, you asked DAO/ADO or Excel (without
Access)
to evaluate DLookUp which is not found of course as neither Excel or DAO/ADO
were aware of Access. Note that Access consists of basically 3 fairly
independent components, namely Access itself, DAO/ADO and VBA. If my memory
serves me right, an earlier post (from MichKa, I think??? - but if the
statement is wrong, then it is not from MichKa) stated that the ability of
DAO/ADO to interpret and refer Access inbuilt functions back to Access is
something special that only works when you "run" DAO/ADO from Access (or
something like that anyway).
Try adding the Microsoft Access Object Library to the References Collection
of your Excel workbook, then modify your Query to show
... "Access.DLookUp" ... rather than just "DLookUp"...
in your Access Query and then test it again in Excel.
I tried the DLookUp & Nz function in Excel this way (but not in a Query) and
they work correctly.
If it still doesn't work, try evaluating the Access.DLookUp function
"outside" the SQL String. This may not be possible depending on your SQL
String.
HTH & good lucks
Van T. Dinh
Quote:
> On Dev's site, he points out this bug:
> Bugs: Undefined Function in Expression (Error 3985)
> http://www.mvps.org/access/bugs/bugs0025.htm
> Can this bug also explain why calling an ACCESS query from EXCEL would
> produce
> Undefined function <name> in expression. (Error 3085)
> As related to DLOOKUP function within ACCESS query???
> Thank you,
> Bill