Solved

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

Posted on 2014-12-09
4
138 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
  • 2
4 Comments
 
LVL 33

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
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.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

776 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