Data Misnatch in NotInLIst Event

I passed the Auto number (because it's the primary key) not the Student ID.

but in the Open form event in the parent form it highlighted Me.Student_Auto with an error (Method or data member not found)
 
Do you have a control named Student_Auto in the next form?

Oops: Dim Args As Variant - belongs in the open event also!
 
Last edited:
but how are they going to be linked

in my structure I'm linking them using another table student_parent which will have the primary keys of both students and parents?
 
You can still link them in the same fashion. You just need to update the linking table after you have both keys.
 
Probably in the Parent/Gardian form after you have all of the required information. You could do it in the Close event before returning to the Student form. Frankly I do not have a great deal on experience with Many-to-Many relationships and I'm having trouble getting my arms around this one. (As if it didn't show) :)
 
me too, I'm lost too!

actually I have 2 equirement from the user:

1) the student information has to be added before the parent information

2) a parent can have more than one student ( we need only one parent for each student) so it's actually a one-to-many relationship

i did it the way I did only because when I tried to do it one-to-many (by adding the parent id as a foreign key in the student table) I have to add the parent id when entering student information

what do you suggest?
 
I was sort of hoping Pat or one of the other guru's would jump in with some useful suggestions. We can create all of the elements needed but I'm not sure how to present them. Maybe some googling will help and maybe another look at the NorthWind example.
 
Thanks alot Rural.

I was looking at Northwind and I'll check this link now.

You are my hero!
 
You can call me RG for short. :D

Both of the samples are pretty straight forward. Each contains two forms each having a SubForm. Our example would be one form shows the Student and the SubForm shows all of the Parents/Gardians associated with this student. The other form shows the Parent/Gardian and the SubForm shows all of the Students associated with this Parent/Gardian. Your tab form is probably just fine as an interface. At least it sort of puts it all on the screen at the same time.
 
Last edited:
I think i'm going to change the structure back to One-To-Many (one parent can have more than a student in this school), I don't want the user to create the student, then the parent and afterwards" manually" attach their IDs.

I'm trying it now..
 

Users who are viewing this thread

Back
Top Bottom