Question in form

A

Ac

I try to create a form to list student information together. Example: one
student selected 5 classes and another selected 3,…
On the form, I would like to group student classes together:

Student 1
Class 1, time taken, score…
Class 2, time taken, score…
Class 3, time taken, score…
Class 4, time taken, score…
Class 5, time taken, score…
Student 2
Class 1, time taken, score…
Class 2, time taken, score…
Class 3, time taken, score…
…..

In the table, the classes that one student took may not be listed together.
The records in the table like:

Student 1, Class 1, time taken, score…
Student 1, Class 2, time taken, score…
Student 2, Class 1, time taken, score…
Student 1, Class 5, time taken, score…
Student 1, Class 3, time taken, score…
Student 1, Class 4, time taken, score…
Student 2, Class 2, time taken, score…
…
Is that possible to group the classes together for a student in a form just
like the way in Report? Thanks!
 
J

John Spencer

Not really possible in a continuous form.

If you are content to use a single form (and one student at a time), you
could use a subform to display the class information for the currently
displayed student.

It would be best if you had a Students table and StudentClasses table.

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
C

Chris O''''Neill

Let me make sure I've got this right, John, but isn't this a classic example
of a many-to-many relationship between the "student" and "classes" tables?
If so, then the "StudentClasses" table provides the many-to-many
relationship, right? In other words, the table structures would look
something like this:

"Students" table:
-------------------

StudentID AutoNumber Unique Student ID
Name Text Name of the student
(other tables describing the attributes of a student)

"Classes" table:
-----------------

ClassID AutoNumber Unique Student ID
ClassName Text Name of the class
(other tables describing the attributes of a clas)

"StudentClasses" table"
--------------------------

StntClassID AutoNumber Unique ID
StudentID Long Int From table "Students"
ClassID Long Int"John From table "Classes"
Score Long Int Student's score for the class

It's the one-to-many relationship between "Students" (one) and
"StudentClasses" (many) PLUS the one-to-many relationship between Classes
(one) and StudentClasses" (many) that provides the many-to-many relationship
between "Students" and "Classes", right?

Once he's got this structure setup, AC can use the "StudentClasses" table to
create datasheet subforms showing "students in a class" or "classes for a
student" depending on how he filters the records.

I *think* I've got that right, but the whole many-to-many relationship
thing, and how you structure tables to deal with it, really confuses the heck
out of me. If I've misunderstood any of this, or have anything wrong, please
feel free to correct me.

Thanks for increasing my understanding!

Regards, Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top