Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Columns to List data separated by a coma

Status
Not open for further replies.

puppy39

Programmer
Mar 13, 2009
41
US
I have a one to many relationship table and I would like to display the many relationship data in a report separated by a coma instead of a column. Any suggestions...

Example
This is what it displays now

LeadID CountyName
102 Orange
102 Lake

104 Orange
104 Lake
104 Polk
104 Seminole

This is what I am trying to accomplish

102 Orange, Lake
104 Orange, Lake, Polk, Seminole
 
I am trying to apply this to a report not a query. I am currently using ADP with SQL. Where and how do I call the module. Do I call the module in the OnOpen Event of the report?
 
I'm not sure this solution will work in an ADP and don't have the time to test it. You could try a multi-column subreport that displays across then down.

There are SQL solutions that might allow you to duplicate the Concatenate() function with an SQL Server function or stored procedure. Again, this is a bit more than I have time to test. You might want to try google or post a question to the SQL Server forum.

Duane
Hook'D on Access
MS Access MVP
 
I can work with the multi-column but How do I create It? I have been trying to do that all day but no matter what I do I still get only one column

ReferralID
102
Orange
Lake

104
Orange
Lake
Polk
Seminole
 
Not sure where you are with all of this.

You can do a group break on the LeadID and then have the subreport in the break like Dhookom stated. You set the columns in the page setup.
1)Create the main report with the group break.
2)Then create another report (this will be your sub report).
3)In page setup (on the sub report) set the columns to whatever you can fit. Across and then down.
3)Reopen the main report and click on the subreport tab. Look for your report and add it.

Hope this helps. Ping me back if you need more info.

Remember when... everything worked and there was a reason for it?
 
Yep that is how I have it set up. My problem is with the sub-report/column setup that I can't get it to display in columns. This is what I have in the PageSetup

Number of Columns: 4
Row Spacing: 0.5"
Column Spacing: 0.25
Column Size: Width 1.5 Height 0.1875
Column Layout: Across, then Down

Yet what I get in the preview is

Lead ID 1
Hills
Pinellas

Lead ID 2
Brevard
Hill
Lake
Marion

What I am doing wrong? Is it that I can't have grouped by LeadID? :-(

 
Your grouping should be fine. Try running the subreport stand alone and see if you get the columns coming out properly. Your have this in the header on the grouping, yes ?

Remember when... everything worked and there was a reason for it?
 
Running the subreport stand alone does not give me the columns. What do you mean by "Your have this in the header on the grouping, Yes?
 
When you do a grouping, there is a header and a footer. I wanted to know where you had it.

Ok, we ruled out the report/subreport problem. It is something with the columnized report itself.

Just a stupid question. Do you have your report pulled out wide enough for this ? Your report should be 4 * 1.5 + .75 = 6.75 inches.



Remember when... everything worked and there was a reason for it?
 
OMG!!! I feel like a total....

The only way you can actually see the columns is if you view the report in the Print Preview!!!! I was always in Report View. Office 2007 has Report View, Print Preview, Layout View and Design View. The only one that truly displays the end result of the report is Print Preview. I had Office 2007 installed last month still learning.

I can't thank you all enough for hanging in there and replying back to me! I would still like to have it separated by a coma this way it will take less space on the report but for now I will work with this.

If I can bother all of you with one more thing. The reason I changed the database from mdb to adp was because every thing I read recomended to that. Can I switch back? Should I switch back? Any suggestions???
 
puppy39,

Give this method a shot... faq703-3587

Si hoc legere scis, nimis eruditionis habes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top