Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have three tables. Student, Class, and StudentClassMap (many to many) that are laid out like so:

Student:
SID - PK
Student Name

Class:
CID - PK
Class Name

StudentClassMap:
SID - FK | PK
CID - FK |
Grade

Now I want to make a form based of Student with a subform that shows all of their classes and the grades in those classes. I can easily do this by selecting the student table and going to Create Form. Now the subform that is auto generated just shows the CID and Grade. So to pretty it up I created a query that returns SID, Class Name, and Grade and set this as the source for my subform.

So now I have a form with the info about the student and a subform showing the Class Name and Grade for the class. I can easily add new Students and change the Grades for the classes each Student is already in. My question is how can I make it so I can add students to classes from this form. When I try to enter a class name in the subform I get an error that says I can not edit this value.

Note: I'm not trying to create a new class, the class exists in the class table... I just want to be able to add it to my subform on the student form.

Ideal situation would be for the Class Name column of the subform to be a dropdown of the Class Names that exist in the Class table.

Let me know if that makes sense.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

On the Student form, your subform should be the rows in StudentClassMap. Then change the CID column to a select box, and set its row properties to display Class Name. That should allow you to add/remove classes from the student, as well as edit the grade, on the Student form.

share|improve this answer
    
That sounds like what I want to do, but I am relativley new to using Access... How exactly do I change the CID column to a select box? and how exactly do I set it to display ClassName? –  Chris Frazier Dec 11 '10 at 18:28
    
Ahh I figured it out. I opened the Map table and used the Lookup settings to specify CID as a lookup from the Class table. Thanks Stemen. –  Chris Frazier Dec 11 '10 at 18:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.