Help - UnParsing Data

  • Thread starter Thread starter RobSol
  • Start date Start date
R

RobSol

I need some serious help with VBA. I am trying to get multiple records into a
separate table in one field. Here is my example:

Table 1

Request Number Product Product ID
Record 1 951 Bank:####
Record 2 951 INV:####
Record 3 951 Bank:###

I need to put the product into a separate table that has the request number
already listed. I need to separate it by using commas ",".

Table 2
Request Number Product
Record 1 951 Bank:####, INV:###, Bank:###

I am using Access 2003 with ADODB connections. Does anyone know how to write
this in code?
 
Take a look a Duane Hookom's Concatenate function example.
http://www.rogersaccesslibrary.com/OtherLibraries.asp#Hookom,Duane

You could use that in a query
SELECT Distinct [Request Number],
Concatenate("SELECT Product FROM YourTable WHERE [Request number] = " &
[Request Number],",") as Products
FROM YourTable

--
John Spencer
Access MVP 2002-2005, 2007-2008
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
Back
Top