Avatar of Hammer8
Hammer8
Flag for United States of America asked on

Running Access queries containing user defined functions in Excel

Hi, I have an Access database with queries which references user defined function located in a module in the database.  The query runs fine in Access.  

I would like to run this query from VBA Excel so I can dump the results into my spreadsheet.  However, I am getting an error saying that my user defined function cannot be found: Run-time error '3085'  Undefined function 'userfunction' in expression.

Is there a work around to this?  I tried cutting and pasting the Access vba code for that function into the Excel module, but am getting the same error.

Thanks in advance!  

Hammer8
Windows Server 2003Microsoft ExcelMicrosoft Access

Avatar of undefined
Last Comment
Rory Archibald

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Patrick Matthews

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Hammer8

ASKER
Yes, trying to run it from Excel VBA.  What does automate from Access mean?  I need to initiate the query from Excel because my macro does more than just pull in the query in question.  Thanks.
SOLUTION
Rory Archibald

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy