Table Relationship clarity (1 Viewer)

Prayder

Registered User.
Local time
Today, 09:58
Joined
Mar 20, 2013
Messages
303
I understand relationships and somewhat how they work, but Im still a little confused.... My question is this:

If I have two tables with one being: Employees and one being: payroll
and they have a one to many link based off a primary key of employee id.

The employees table being one and the payroll table being many.

If I were to look up an employee name from the employee table would the information from the payroll table show up automatically or would I have to have txt boxes with the recordsource being those fields in the payroll table?
 

catalin.petrut

Never knowing cleric
Local time
Today, 17:58
Joined
May 3, 2013
Messages
118
Relationships are betwen tables. Entering date is made using forms (this is the idea of an app: user dont have to access tables). Viewing data is possible by reports (same logic).
To answer your question, you can see the payroll data using a report (or a form).
 

Prayder

Registered User.
Local time
Today, 09:58
Joined
Mar 20, 2013
Messages
303
Ok, so if a person is pulling data from individual tables with reports and adding data using forms... then what is the point of relating tables together?
 

Balthazar

New member
Local time
Today, 15:58
Joined
Jul 8, 2013
Messages
9
The reason you'd relate tables together is because, when you have a main form for the Employees, the Payroll subform would need to know which Employee it was showing the details of, which would be done by relating it using the EmployeeID.
 

Prayder

Registered User.
Local time
Today, 09:58
Joined
Mar 20, 2013
Messages
303
So if I were to type in the employee id in the main form the subform would automatically populate with payroll info based off of that emloyee ID if there were linked together?
 

Balthazar

New member
Local time
Today, 15:58
Joined
Jul 8, 2013
Messages
9
Yes. Also, when you made any additions to the subform, it would update the table. Think of it like like grouping everything under the EmployeeID. It makes everything a lot easier.
 

Prayder

Registered User.
Local time
Today, 09:58
Joined
Mar 20, 2013
Messages
303
ok, in the subform.... would the fields in that form have to have the fields in the payroll table as their recordsource or would the populate soley off of me putting in the employee id on the main form?
 

catalin.petrut

Never knowing cleric
Local time
Today, 17:58
Joined
May 3, 2013
Messages
118
The form will show employee table fields. The subform will show only the payroll table fields that are related with the employee in the form. You can make a lot of things in the form: you can navigate employee by employee (and each time the subform records will change), you can design a search field so you can look for aployees by SSN or name or ID or anything you like and get the payrolls. All that depends on what you want from your app.
 

Users who are viewing this thread

Top Bottom