Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8986559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:34:46+00:00 2026-06-15T21:34:46+00:00

I have been using Allen Browne’s ConcatRelated function, and while it works fine when

  • 0

I have been using Allen Browne’s ConcatRelated function, and while it works fine when the data comes from a table, but it doesn’t work when the data comes from a query.

The green ‘running query’ bar appears for a few seconds, but then when it tries to display the data it shows only one field from the first row, runs very slowly and can take a few minutes to display the first screen of records. I’ve not managed to leave it long enough to complete the result set, have to shut down Access using the task manager.

Is the query getting run each time the function is called? That could explain why it takes so long but seems unlikely.

Is this a problem with the function, with the query that is calling the function, or the query that the source data is coming from?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:34:47+00:00Added an answer on June 15, 2026 at 9:34 pm

    Here is an example using that function in the Immediate window.

    CompanyID = 7
    ? ConcatRelated("OrderDate", "tblOrders", "CompanyID = " & CompanyID)
    12/11/2012, 12/12/2012, 12/13/2012
    

    The function …

    1. creates this SQL statement

      SELECT OrderDate FROM tblOrders WHERE CompanyID = 7

    2. opens a Recordset based on that statement

    3. loops through the Recordset adding each OrderDate value to its output string

    IOW, ConcatRelated() performs quite a bit of work each time you call it. And when you call it as a field expression in a query, it has to perform all that work again for each row of the query’s result set.

    In addition to that “fixed overhead”, ConcatRelated() may lead to an additional performance cost: Without an index on CompanyID, the db engine would have to use a full table scan of tblOrders to find the rows which satisfy the WHERE clause.

    Your question asks about the impact of using a query instead of a table with ConcatRelated(). Then the function’s internal SQL statement will be:

    SELECT OrderDate FROM YourQuery WHERE CompanyID  = 7
    

    In addition to the performance challenges imposed by ConCatRelated() with a table, you risk 2 more which may dramatically increase the workload.

    1. If YourQuery demands a lot of effort by the db engine, it must put in that effort to create each row of the parent query’s result set.
    2. You increase the likelihood that the db engine will not be able to used an index for the WHERE clause in the function’s internal SQL statement. Even if there is an index on CompanyID in the underlying table source of YourQuery, the db engine may not see enough benefit from using it.

    So while ConCatRelated() is useful, using it is costly. That’s not because of any design error in the function. Rather the nature of the task is just so expensive regardless of what approach you use to accomplish it. And asking that function to use a query instead of a table likely inflates the cost.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using Objective-C for a little while but being from a static
Have been using the SharpeRatio.annualized() function from Performance Analytics for awhile with no problems.
I have been using CI just fine using the MySQL driver. I want to
I have been using Matlab 2011b and contourf/contourfm to plot 2D data on a
I have been using Tomcat for a while. But I have never get myself
I have been using DataVisualization.Charting.Chart to produce few charts. Everything works very well, until
I have been using JGraphX to display some data (simple discrete graphs) and I
I have been using Flurry.com to capture my analytical data for my iPhone app.
I have been using C++ for a while now and I began to get
I have been using the PyDev in eclipse for quite a while with no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.