Originally Posted by
ArviLaanemets
On Fly! Probably you need at least some of tables below (your further design depends on which ones you'll have)
tblEmployees: EmployeeID, ForeName, LastName, EmployedAt, LeavedAt;
tblAssignments: AssignmentID, Assignment (you need this table and next one, when different assignments need different sets of courses);
tblEmployeeAssignments: EmployeeAssignmentID, EmployeeID, AssignmentID, AssignmentAt;
tblCourses: CourseID, Course;
tblAssignmentCourses: AssignmentCourseID, AssignmentID (you need this table, when different assignments need different sets of courses);
tblEmployeeCourses: EmployeeCourseID, EmployeeID, CourseID, CourseStartAt, CourseEndAt, ...;
...
You'll have a single form to display employee info (e.g. fEmployee), with query from table tblEmployees as source. The query returns info for employees with date field LeavedAt empty;
You'll have a continuous form to display employee's courses (e.g. fEmployeeCourses), with query from tblEmployeeCourses as source;
You create a subform (e.g. sfEmployeeCourses) in fEmployee, with fEmployeeCourses as source, using EmployeeID to link the forms (LinkChieldFields and LinkMasterFields properties in subform);
In form EmployeeCourses, in datarow you'll have a combo box to select the course (e.g. cbbCourse). By default, its rowsource may be simply a query, which returns all courses from tblCourses. You create an Current event for fEmployeeCourses, which updates the RowSource query of cbbCourse in this form, updating the query to limit the returned list with ones not having CourseID present in tblEmployeeCourses for this employee <...FROM tblCourses c WHERE CourseID NOT IN (SELECT CourseID FROM tblEmployeeCourses WHERE EmployeeID = [txtEmployeeID] AND CourseID <> c.Course)>. In case the available courses depend on employees assignment too, you also have add to rowsource query joins to tblEmployeeasignments and to tblAssignmentCourses, and use them to add a WHERE clause to limit the available courses to ones allowed for employees assignment.