Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old January 2nd, 2007, 12:30 PM
Registered User
 
Join Date: Jun 2003
Location: Hull, East Yorkshire, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Displaying items in Colums in roes

I am writing a report and as a beginer, I want to list course programmes for new appliants in rows and its currently in columns> For instance, I have say

Name Subject
Frank Amoko CP2A
Frank Amoko ST2A
Frank Amoko GT1R
Evely Dow BB2A
Evely Dow MU1S

and want the report to look like
Name Subject 1 Subject 2 Subject 3
Frank Amoko CP2A ST2A GT1R
Evely Dow BB2A MU1S

Any help on this
  #2 (permalink)  
Old January 3rd, 2007, 01:35 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2004
Location: Washington, DC, USA.
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts
Default

Build the report using the wizard, and then group on the student name. Then add columns to the report. I have seen it done but have not done it. You can also just have:

Frank Amoko
CP2A
ST2A
GT1R

Evely Dow
BB2A
MU1S

Does that help? If you want to collapse this into a temporary table, it will take some coding.

Who has a more elegant solution?


mmcdonal
  #3 (permalink)  
Old January 3rd, 2007, 05:36 PM
Friend of Wrox
 
Join Date: Jan 2005
Location: Kansas City, Missouri, USA.
Posts: 471
Thanks: 0
Thanked 1 Time in 1 Post
Default

Azambee,
What does your table structure look like? How many courses could each applicant be enrolled in?

As mmcdonal said, with a little bit of coding, you could create a temp table, that recreates itself each time you run the report.

The code itself isn't difficult.

HTH,

Kevin

dartcoach
  #4 (permalink)  
Old January 5th, 2007, 04:43 AM
Registered User
 
Join Date: Jun 2003
Location: Hull, East Yorkshire, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi mmcdonal, My current report is in the format you have described but they want each student's courses to be on the same row. So for Frank Amoko for example his should read as;
Student Name Subject1 Subject2 subject3
Frank Amoko CP2A ST2A GT1R
Evely Dow BB2A MU1S

Each student could enrol an a maximum of 7 courses and any point in time. If I want to use code how can I do it. I am just a beginner. I have read books but not getting the correct code to do it. Any ideas.
etc
Quote:
quote:Originally posted by mmcdonal
 Build the report using the wizard, and then group on the student name. Then add columns to the report. I have seen it done but have not done it. You can also just have:

Frank Amoko
CP2A
ST2A
GT1R

Evely Dow
BB2A
MU1S

Does that help? If you want to collapse this into a temporary table, it will take some coding.

Who has a more elegant solution?


mmcdonal
  #5 (permalink)  
Old January 5th, 2007, 04:57 AM
Registered User
 
Join Date: Jun 2003
Location: Hull, East Yorkshire, United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The structure of the table is like this:
StudentID, Student Name, DOB, Subjects

The new Structure will look like this;
StudentID, Student Name, DOB, Subject1; Subject2, Subject3 ....Subject7

I tried coding it but because I am new to VBA its not working. Any help with the code??
Quote:
quote:Originally posted by dartcoach
 Azambee,
What does your table structure look like? How many courses could each applicant be enrolled in?

As mmcdonal said, with a little bit of coding, you could create a temp table, that recreates itself each time you run the report.

The code itself isn't difficult.

HTH,

Kevin

dartcoach


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to Distinct two colums but select other colums ALPEN07 SQL Server 2005 2 April 5th, 2008 06:08 AM
onlick display more colums mateenmohd Classic ASP Basics 5 July 28th, 2007 07:12 AM
Combo box items not displaying djam C# 3 March 22nd, 2005 04:13 AM
displaying items from a database?? Ashleek007 PHP Databases 3 April 27th, 2004 06:05 PM
displaying 6 items only having 20 items Lakshmi KS VB Components 1 February 17th, 2004 10:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.