Form problem

Nmiskulin

New member
Local time
Today, 05:16
Joined
Sep 23, 2015
Messages
4
Hello all!

I've created a database to keep track of the students and shools they are in.

The structure is folowing:

StudentT
ID_Student -PK (not autonumber, not a problem)
Name
Surname
DateOfBirth

SchoolT
ID_School-PK
Name
Class-(I don't need a separate table, this is not crucial for my DB)

I've created a join table (Many to many relationship):
StudentSchoolT
ID_StudentSchool-PK
Student_ID- FK
School_ID-FK
Date (the date student started attending school)

I am not able to create a form that allows me to add a new student to certain class (school). Access warns me there is no related ID:_Student in the StudentT table. I think the problem is that I am trying to enter data in a parent table through child table.

All I can do is open StudentT, SchoolT and in Student SchoolT and enter:
Student_ID------------------ School_ID
in order to assign a student to school

I want to be able to do this:

Open a form on specific school (class) record and add students to it. Like so:
StudentID------------------Name-------------------Surname------------DateOfBirth----------------Date

Did I set up my database correctly? What method should I use? Table (s) Form/subform, Querry forms, append query, OpenArgs?

Thanks

Neven
 
Last edited:
you must use subforms.
The master form will have the Student (and ID)
and the sub form would be the class. (connected via keys)

Entering data in a master/child form will auto insert the keys.
but because you didnt use autonumber keys (i dont know why)
it could cause the key not to generate.
 
you must use subforms.
The master form will have the Student (and ID)
and the sub form would be the class. (connected via keys)

Entering data in a master/child form will auto insert the keys.
but because you didnt use autonumber keys (i dont know why)
it could cause the key not to generate.

You're right! For some reason I was using personal identification number :-(
I am working on a database now. I'll use the reverse method. My main form will be the school. Thanks (for now) cause I'll have more questions as I go along.

Neven
Thank you very much.
 
you must use subforms.
The master form will have the Student (and ID)
and the sub form would be the class. (connected via keys)

Entering data in a master/child form will auto insert the keys.
but because you didnt use autonumber keys (i dont know why)
it could cause the key not to generate.

:-(

does not work. I created a main form SchoolT with subform StudentT but still the join table stays blank, after I enter the information
Help
Neven
 
well it could be done the other way too.
open a master class form with child students.
then use a list to dbl-click to add the exising students to the subform.
 
well it could be done the other way too.
open a master class form with child students.
then use a list to dbl-click to add the exising students to the subform.
Sorry, I don't understand. Which field/combobox should I dbl click?Tnx
Neven
 

Users who are viewing this thread

Back
Top Bottom