Link to home
Start Free TrialLog in
Avatar of LeighWardle
LeighWardleFlag for Australia

asked on

Microsoft Access 2010 query gives error: Undefined function 'DCONCAT' in expression

Hi Experts,

I'm trying to move some code from a sample database defined in this question:

to my production database.

The DConcat function is from Patrick Mattews article Domain Aggregate for Concatenating Values.

I have put a copy of DConcat is a module called DConcat.

This is the query that gives the error:
SELECT [MailChimp Export0].ClientID, '"' & DCONCAT("[ItemCategory]","[MailChimp Export0]","ClientID = '" & [ClientID] & "'",",") & '"' AS ItemCat
FROM [MailChimp Export0]
GROUP BY [MailChimp Export0].ClientID, '"' & DCONCAT("[ItemCategory]","[MailChimp Export0]","ClientID = '" & [ClientID] & "'",",") & '"';

This is the query that it refers to (MailChimp Export0):

SELECT CLIENTS3.ClientID, Items.ItemCategory
FROM CLIENTS3 LEFT JOIN ([Item Transactions] LEFT JOIN Items ON [Item Transactions].ItemID = Items.ItemID) ON CLIENTS3.ClientID = [Item Transactions].CustomerID
GROUP BY CLIENTS3.ClientID, Items.ItemCategory;

Regards,
Leigh
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

>>Undefined function 'DCONCAT' in expression

Did you follow the article's step 3?

https://www.experts-exchange.com/articles/2380/Domain-Aggregate-for-Concatenating-Values-by-Group-in-Microsoft-Access.html

3. Implementing DConcat in Your Access Projects

To implement DConcat in your Access project, all you need to do is add the source code above to a "regular" VBA module (i.e., not a class module, nor a code module for a Form or Report).  Once you have done this, you will be free to use the function in your queries, forms, or reports in the Access UI, or you may call DConcat from your other procedures in the VBA project.
ASKER CERTIFIED SOLUTION
Avatar of Gustav Brock
Gustav Brock
Flag of Denmark image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of LeighWardle

ASKER

Hi Ryan,

Can you please step me through adding the source >>code above to a "regular" VBA module?

>>To implement DConcat in your Access project, all you need to do is add the source >>code above to a "regular" VBA module (i.e., not a class module, nor a code module >>for a Form or Report).
Thanks, Gustav
Thanks, Ryan - please ignore my request.
You are welcome!

/gustav