Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Display Records Horizontally in Access

Posted on 2010-11-15
7
Medium Priority
?
563 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Suggested Courses

610 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