How to create a form to edit a one to many relationship?

Using MS Access 2007, I am creating a student management database. I have tables for:

  • Students
  • Courses
  • CourseSection

What I needed is a way to assign students to a course section. So I created a table that links students and sessions:

  • StudentsInSection (contains foreign key to students and foreign key to course section)

I would like to create a form that allows me to edit a section and add students from the list of students. I've done lots of relational database work, just never with access. It seems like such a simple thing. Anybody know a good way to do this?

Answers


Create a form bound to the StudentsInSection table. If you want to be able to edit the students in the section, the easiest thing to do is to use a combo box with a row source based on the Students table with the bound column of the combo box tied to the student ID in the recordset underlying the StudentsInSection form. This form will be your subform. Set the Default View property of the form to "Datasheet" or "Continuous Forms". Save and close the form.

Create a form bound to the CourseSection table. From the Forms list, click and drag the first form based on the StudentsInSection table onto the design area of the CourseSection form.

In the property sheet of the new subform control, set the Link Master Fields property to the Section ID of your CourseSection table. In the Link Child Fields property, set the value to the Section ID of your StudentsInSection table. Setting these properties will filter the subform data to match the current value in the parent form as records are navigated.


Need Your Help

How to include a local table of contents into Sphinx doc?

python documentation python-sphinx

How to include a local table of contents into Sphinx doc?

websocket in php wont connect to server.php

php sockets websocket

here is my code and this work perfectly it sends the message. but server.php doesnt receive it. now if I use javascript and html5 and send to ws://localhost:8000/instantchat/server.php it works of

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.