A
April Marano
I'm using Access 97 to do the following:
I have a form called frmStudents based on a table called tblStudents which
has a primary key called StudentIDNum as well as fields such as Name, DOB,
etc. There is also a field called CurrentTeacherIDNum which contains the ID
number of the student's most recent teacher.
frmStudents contains a subform (in datasheet view) called sbfTeachers.
sbfTeachers is bound to a table called tblLinkStudentTeacher which contains
in addition to a primary key, the fields StudentIDNum and TeacherIDNum.
Each student will have ONE teacher at a time but will have a "history" of
several teachers. The subform will show all the teachers a student has in
the order in which they were entered. Form and subform are linked by child
and master fields StudentIDNum.
I want to fill the frmStudents field CurrentTeacherIDNum with the
TeacherIDNum of the most recently entered teacher from the subform using an
event handler executed from sbfTeachers using the AfterUpdate event. How do
I do this? I think I'd be OK if I could figure out how I NAME the
CurrentTeacherIDNum field in my code. I've tried
Forms!frmStudents!CurrentStudentIDNum = Me!TeacherIDNum
but this doesn't work. Any ideas?
April
I have a form called frmStudents based on a table called tblStudents which
has a primary key called StudentIDNum as well as fields such as Name, DOB,
etc. There is also a field called CurrentTeacherIDNum which contains the ID
number of the student's most recent teacher.
frmStudents contains a subform (in datasheet view) called sbfTeachers.
sbfTeachers is bound to a table called tblLinkStudentTeacher which contains
in addition to a primary key, the fields StudentIDNum and TeacherIDNum.
Each student will have ONE teacher at a time but will have a "history" of
several teachers. The subform will show all the teachers a student has in
the order in which they were entered. Form and subform are linked by child
and master fields StudentIDNum.
I want to fill the frmStudents field CurrentTeacherIDNum with the
TeacherIDNum of the most recently entered teacher from the subform using an
event handler executed from sbfTeachers using the AfterUpdate event. How do
I do this? I think I'd be OK if I could figure out how I NAME the
CurrentTeacherIDNum field in my code. I've tried
Forms!frmStudents!CurrentStudentIDNum = Me!TeacherIDNum
but this doesn't work. Any ideas?
April