I followed Richard's great video to create the MS Access Employee Training database. Around video 5 he created the EmployeeCourseSubF (form) and it appears I missed something. When I have an a new employee and haven't assigned any roles, the EmployeeCourseSubF form still shows all the available courses, even though the employee doesn't have a role yet. I'm thinking the data source (EmployeeXCourseT) is either incorrect or the datasource for the "Course" field is incorrect. It points to the course table, but I'm thinking it should point to a query. Thanks for any help.
Raymond Spornhauer
@Reply 6 months ago
Without seeing how you have this setup, we can't help.
I would suggest following along with Rick's video from start to finish and make sure you don't miss any steps.
-Raymond
Danny ChinOP
@Reply
6 months ago
In Richard's database, each employee has one-to-many roles. The roles have one-to-many courses to take. In his video, the main form has the employee id, name, etc. and two subforms, one for the roles the employee has, and another subform that shows the courses based on the employee's roles. The role subform uses a query to list the roles the employee has based on their employee id. The role subform seems to work correctly since it shows roles only the roles that have been assigned to that particular employee. However, the courses subform appears to be listing the same courses for all employees, regardless if they have no roles yes or some roles. I expect the course subform to show no courses if the employee has not roles assigned. I don't know if this would help, the recordsource used for the course subform is a table named EmployeeXCourseT which only has courses for one employeeID. For the detail rows of the course subform, the control source is CourseID and the row source is a table named CourseT which only contains all the courses. That's where I think something is amiss. Richard's video shows that same configuration. My question - if the recordsource for the subform doesn't have any values matching the employee id, why would we use a different table (courseT) to the rows? I've double/triple checked against Richard's video (episodes 4 and 5) and I'm pretty sure, but not 100%, that I didn't miss anything. I'll check again, though. :) Thanks.
Raymond Spornhauer
@Reply 6 months ago
@0[Danny-Chin]
Without seeing what you have... I can only guess:
It sounds like you don't have the Master and Child Fields setup in the second subform.
Click on the SubForm, make sure the SubForm is selected, then in your Properties, look at the Data Tab and ensure the Master and Child Fields Primary and Foreign Keys are correct.
-Raymond
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Visitor Forum.