View Full Version : Relationship question


edub
06-08-2009, 04:47 AM
Excuse the new guy here. If this question is in the wrong section, please move it.

This has been kicking my butt for some time now. I have a db and 4 tables; tbl_Employees, tbl_Address, tbl_EmployeeData, and tbl_Training.
I have forms for each table as well.

I want the data I enter for all the employees (tbl_Address, tbl_EmployeeData, and tbl_Training) to populate correctly and link to the right employee.

Is it possible to add the data via my frm_Employees for the employees initially. Then I want to be able to add the address for that pertains to each employee via the other form. So I basically want to see and link the two tables to gether, but I just can't get the relationship correct. I assume I am doing it wrong or I don't have the process/knowledge down.

Thanks, look forward to the help, E-dub

Mr. B
06-08-2009, 05:51 AM
edub,

What you are describing is exactly why Access has forms and sub forms. You can insert your form for the additional data entry as a sub form of your Employee form and link it to the main form via the EmployeeID field.

Just one thought that came to mind as I read your posting. In your situation, do you really have your database designed correctly? If in your case you really have to have multiple addresses for each employee then you should have the additional table. If not then the additional table is not needed. I would have the same question concerning the "tbl_EmployeeData" table.

Just my thoughts.

HTH

edub
06-08-2009, 06:18 AM
Mr. B,

Thanks for the reply! Are you saying that I should just have on huge table and utilize different forms to populate the data? My design, understanding and application is wrong then? That would illiminate the requirement for creating the relationship...

How would I create the relationship with each employee and a huge amount of training requirements with yes/no categories and completion dates with a comments block?

Thanks again, E-dub

Mr. B
06-08-2009, 06:33 AM
edub,

All information that is directly related to a single employee (Name, Address, City, Zip, etc) and even other info like Date of Birth, SS number, number of children, and even hire date, would be in one table unless you have some kind of strange situation that requires something else. (I am thinking about where there may be a requirement to track previous addresses where the employee lived. This is not a normal situation.)

If you do not need multiple tables, then you would only need one form to enter the Employee's info.

Your training info would be a different story, because that would be a one-to-many situation. (I actually think that the training issue may need to be a many-to-many situation. In the past when I have designed databases for tracking employee training, there has been a need for a many-to-many linking between the employee and the list of training classes.)

Hopefully this will at least get you started in the right direction.