?
Solved

Display Records Horizontally in Access

Posted on 2010-11-15
7
Medium Priority
?
553 Views
Last Modified: 2013-12-25
I want to display the records of an evaluation table horizontally instead of vertically.  Through an answer from this website (a really long time ago) I was able to create an SQL query that did just that.  Here is a sample:


EvalID      Q1      Question02      Question03      Question04
244                4              4                      4                      4
245                5              5                      4                      5
246                5              5                      5                      5
247                5              5                      5                      5


When I run the SQL, it appears like this:

Questions      244      245      246      247
Question01      4      5      5      5
Question02      4      5      5      5
Question03      4      4      5      5
Question04      4      5      5      5

The 244, 245 etc are the EvalID that will change every time the query is run.

Here is the code behind the SQL:
TRANSFORM MAX(COMB.TV) AS MTV
SELECT COMB.Questions
FROM (SELECT EvalID,Q1 as TV,'Q1' as Questions FROM qryEvalScores
UNION
SELECT EvalID,Question02 As TV,'Question02' as Questions FROM qryEvalScores
UNION
SELECT EvalID,Question03 AS TV,'Question03' as Questions FROM qryEvalScores
UNION
SELECT EvalID,Question04 As TV,'Question04' as Questions FROM qryEvalScores AS COMB
GROUP BY COMB.Questions
PIVOT COMB.EvalID;

It works great in the query.  The problem is, I would like to build a report but I can't because the EvalIDs will change each time rendering any textboxes in the report obsolete.

I think what I need to do is put the SQL into VB to recreate the report each time, I am just not sure how to do it.  

Any help would be appreciated.
0
Comment
Question by:Cindy6777
[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
  • 3
  • 2
7 Comments
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 2000 total points
ID: 34142401
This is the inherent problem with wanting to display data in this fashion...

Here is one solution, ...Happy Reading.
http://support.microsoft.com/kb/328320

;-)

JeffCoachman
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 2000 total points
ID: 34142402
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 2000 total points
ID: 34142466
Another Option:
(If possible) create a standard "Normalized" table for your data.
At least in this way you can create a simple crosstab query to get the same results.
Then print the Crosstab query directly...?

Simple sample attached, see the table and query
db315.mdb
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 44

Expert Comment

by:GRayL
ID: 34191751
Can you show us the structure of query qryEvalScores
0
 
LVL 44

Expert Comment

by:GRayL
ID: 34191795
How about:

TRANSFORM MAX(COMB.TV) AS MTV
SELECT COMB.EvalID
FROM (SELECT EvalID,Q1 as TV,'Q1' as Questions FROM qryEvalScores
UNION
SELECT EvalID,Question02 As TV,'Question02' as Questions FROM qryEvalScores
UNION
SELECT EvalID,Question03 AS TV,'Question03' as Questions FROM qryEvalScores
UNION
SELECT EvalID,Question04 As TV,'Question04' as Questions FROM qryEvalScores AS COMB
GROUP BY COMB.EvalID
PIVOT COMB.Questions;
0
 
LVL 53

Expert Comment

by:Dhaest
ID: 34440900
This question has been classified as abandoned and is being closed as part of the Cleanup Program.  See my comment at the end of the question for more details.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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.
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 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