?
Solved

Display Records Horizontally in Access

Posted on 2010-11-15
7
Medium Priority
?
570 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
  • 3
  • 2
6 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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

850 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