I have watched the Access videos but I am like I am square one. I want to create a database where I can do the following but for some reason I cant make it happen. Example is lets say Person 1 owns 3 cars and peron 2 owns 2 cars. I want to be able to lookup and print a report that shows only the cars person 1 or person 2 owns.
Kevin Yip
@Reply 3 years ago
To make that happen, you need "primary keys" that uniquely identify all the persons and all the cars. For instance, a persons table and a cars table would look like:
PersonID (PK) PersonName
1 John A.
2 Juan B.
CarID (PK) CarName
1 2022 Buick Encore
2 Tesla Model S
3 1987 Oldsmobile
Then, in order to say who owns what cars, you need a third table that makes use of the primary keys above:
To "say" that "John owns Tesla Model S," you make an entry like the first line above: with PersonID equals 1 (which stands for John) and CarID equals 2 (which stands for the Buick). The 2nd line, PersonID = 1 and CarID = 3, means John owns 1987 Oldsmobile.
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.