Solved

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

Posted on 2014-12-09
4
132 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
Comment Utility
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 119

Accepted Solution

by:
Rey Obrero earned 250 total points
Comment Utility
test this revised db from previous thread
db5.mdb
0
 
LVL 1

Author Comment

by:ajaeclarke
Comment Utility
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 119

Expert Comment

by:Rey Obrero
Comment Utility
post a new question for another problem
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
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 different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

762 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

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now