Solved

Help with previous question...getting table data into one line...group by

Posted on 2014-12-09
4
142 Views
Last Modified: 2014-12-09
Hi

I originally posted a question that Jeffrey Coachman supplied some code that worked great...thanks Jeff.  

How can I get multiple records displayed in one line

After running some tests, I am now wanting to do some grouping.  For example the returned data is:

W~AP 280 GNC~AP 280 Qu~AS 266 GNC~AUH2 283 ADM~B 465 AGE~BA 278 Qu~BU1 293 ADM~CO 293 ADM~F1 254

I am wanting the AP 280 to be grouped together so it displays like:

W~AP 280 GNC Qu~AS 266 GNC~AUH2 283 ADM etc etc.

This will be the same for any of the same letters after the ~ with the same number.

I hope I have explained this okay....if not please let me know and I shall try to clarify.

Thanks

Ajae
0
Comment
Question by:ajaeclarke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 34

Assisted Solution

by:Mike Eghtebas
Mike Eghtebas earned 250 total points
ID: 40488406
You need to group by first and then use jeff's solution at:

change:
Set rst = CurrentDb.OpenRecordset("YourTable")

to:
Set rst = CurrentDb.OpenRecordset("Select PDCode, PDData From YourTable Group By PDCode, PDData Order By PDCode, PDData")
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 250 total points
ID: 40488874
test this revised db from previous thread
db5.mdb
0
 
LVL 1

Author Comment

by:ajaeclarke
ID: 40490485
Thanks for the comments....both worked great and I have it working now :-)  You guys are great!

I have another questions about a field that I want displayed in a certain way...should I accept these solutions and start another question?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40490494
post a new question for another problem
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

732 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question