title: Concatenation of multiple entries in one row
body: <p>I am trying to concatenate a list of attributes for same products which are in different rows.</p>
  <p>For example:<br />
  Column A (fruit_name) has fruit names and Column B (fruit_colors) has colors.<br />
  I want fruit color on the same row as the fruit.</p>
  <pre><code>|**fruit_name**  | **fruit_colors** |
  |----------------|------------------|
  |Apple           |Red               |
  |Apple           |Yellow            |
  |Apple           |Green             |
  |Apple           |White             |
  |Banana          |Red               |
  |Banana          |Yellow            |
  |Banana          |Green             |
  |Banana          |White             |
  |Plum            |White             |
  |Plum            |Bluish            |
  |Plum            |Purple            |
  </code></pre>
  <p>The result should be:</p>
  <pre><code>|**name**        | **colors**                |
  |----------------|---------------------------|
  |Apple           | Red, Yellow, Green, White |
  |Banana          | Red, Yellow, Green, White |
  |Plum            | White, Bluish, Purple     |
  </code></pre>
  <p>This is what I have:</p>
  <pre class="lang-vb prettyprint-override"><code>Set fruit_name = rstsource.Fields(&quot;fruits&quot;)
  Set source_fruit = rstsource.Fields(&quot;fruits_list_type&quot;)
  
  rstsource.MoveFirst
  count = rstsource.RecordCount
  counter = 0
  
  fruit_name = source_fruit
  result = source_table
           
  Do 
      Do
          counter = counter + 1
          result = result &amp; &quot;, &quot; &amp; source_table
          rstsource.MoveNext
                        
      Loop Until counter = count Or fruit_name &lt;&gt; source_fruit
           
      rstdest.AddNew
      rstdest.Fields(&quot;names&quot;) = fruit_name
      rstdest.Fields(&quot;colors&quot;) = result
      rstdest.Update
                  
      fruit_name = source_fruit
      result = &quot; &quot;
  
  Loop Until rstsource.EOF
  </code></pre>
  <p>This is the result - Some has comma on the front.</p>
  <p>Banana - White, White<br />
  Apple -  ,Yelow, Red<br />
  Banana- ,Red<br />
  Banana - White, White<br />
  Apple , Green<br />
  Plum -   ,Green<br />
  Plum -   ,Red<br />
  Banana - ,Red</p>
  <p>At the end there is a</p>
  <blockquote>
  <p>Run time error 3021.</p>
  </blockquote>