subforms

G

Guest

I have two forms: Employees and training classes. Each has a subform. The
training subform is populated with the employees that have taken the training
class and the date the class was completed. I created a query combining the
training class info with the employees taking the training class.
My problem is the employee training subform. It lists all the training taken
for all employees for all classes, but I want to limit it to only the
training taken by that particular employee.
I am a novice, not a programmer.
Somebody please help.
Thanks,
 
G

Guest

Greg:

The relationship between Employees and TrainingClasses is many-to-many as
each employee can take one or more class and each class can be attended by
one or more employee. A Many-to-many relationship is modelled by another
table EmployeeClasses say. This will have two foreign key columns such as
EmployeeID and TrainingClassID referencing the primary keys of Employees and
TrainingClasses. It might well have other columns recording such things as
whether the employee 'passed; the class for instance, i.e. attributes of the
employee's attendance at that particular class.

In each of your forms the subform should be based on the EmployeeClasses
table, or possible a query which joins this to one of the other two tables.
In the case of the Employees parent form the subform will be linked to the
parent form by setting the LinkMasterFields and LinkChildFields properties of
the subform control to EmployeeID. In the case of the Classes parent form
the links will be on TrainingClassID.

Subforms of this type are usually in continuous form view and contain a
combo box whose RowSource in the case of the employees subform would draw the
EmployeeID and EmployeeName from the Employees table, but show just the name
(the combo box wizard can set this up for you or we can talk you through
handcrafting it). The classes subform would have a combo box drawing on the
TrainingClasses table in the same way. Other values form the Employees or
TrainingClasses tables can be shown in the subforms by means of unbound
computed controls. Again we can advise on this if you provide more details.

Ken Sheridan
Stafford, England
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top