Hi everyone, hopefully can explain myself...lol Building my first database for an aircraft repair company. Have customer table so users can choose customer in combo box booking in repair Job table for parts serial no. part no., type of repair Employee table again combo box to choose employee doing work A document table to choose type of industry repair document.
My main table is the Job table storing each repair but as the form to input the repair has the combo boxes I find my job table needs multiple foreign keys linking customer, employee and which type of document is required.
If I run a query I get all the correct information so must be doing something right... Thanks to Richards videos.
Am I going the right route with these multiple foreign keys?
Sorry for taking so long to get back to you on this one, but yes, you are doing it correctly. Sounds like you have a Customer table, an Employee table, a Document table, and a Job table. Your Job table is going to look like this:
JobT: JobID, CustomerT, EmployeeT, DocumentID
And those are all foreign keys pointing to the other tables. So when you make a query, I'll bring them all together and everything should work just fine. And yes, a lot of tables will have multiple foreign keys but only one primary key.
This is how I teach it to beginners, but (not to blow your mind) when you get a little more advanced, you can also keep all of the same type of "thing" in the same table. For example, customers and employees are generally all people, so it makes your life easier if you keep all of the people in the same table and then just have another field that represents what they are, whether it's a customer, an employee, a vendor, and so on. This way, you don't have multiple tables with all of the same information like address, phone number, and so on. The only exception would be if, for example, your customers have lots of information that you never need for other people like employees, and employees have a completely different set of information like Social Security numbers and payroll information, and so on.
But the bottom line is it's all about how you want to build your database. They're your Legos put them together however you want.
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
Access Beginner 2.