You have a table for Time Records and a Table for Lesson Plans. Do you also have a table for Students and is this the table on which the above layout is based?
I think you have these relationships:
Students::__pk_StudentID = CHECKINOUT::_fk_StudentID
Students::__pk_StudentID = LessonPlans::_Fk_StudentID
Are lesson plans unique to each student or to a class or subject with many students?
I believe that you have this calculation defined in LessonPlans:
Case ( DATE - CHECKINOUT::DATE = 0 and TIME - CHECKINOUT::TIME < 0;
If ( CHECKINOUT::TIME - TIME ≤ SETTINGS::LATE; "CHECKIN"; "NOT CHECKIN" ) ;
DATE - CHECKINOUT::DATE = 0 and CHECKINOUT::TIME - TIME > 0;
If ( CHECKINOUT::TIME - TIME ≥ SETTINGS::EARLY; "CHECKIN"; "NOT CHECKIN" )
If my analysis is correct (and it could easily be wrong), you are referring to records in CheckINOUT via a two stage relationship (lesson plans to students to checkinout). The intervening relationship will cause this calculation to refer to the first Checkinout record, not the one with the same date as the lesson plan record.
You'd need this relationship:
LessonPlans::_fk_StudentID = CheckInOut::_fk_StudentID AND
LessonPlans::Date = CheckInOut::date
So that your calculation can refer directly to the corrected time record from the lesson plan record.
Let me know if this is correct or not.