Help - UnParsing Data

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?
 
J

John Spencer

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
..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top