|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Need help creating an Access Database to keep track of items.
Hope you guys don't shoot people for joining a forum to only ask one question. I just haven't been able to find the answer anywhere else.
Gonna be leaving for a year and I am putting a bunch of stuff on DVD's. I want to create a database that will have a record for each DVD with other records for what the DVD's contents are and then another record with a description for each entry. I want to setup the database something like this... Disk_Label - Source - Title_1 - Title_1_description ..............................Title_2 - Title_2_description (if there is a second title) .................................And so on. I want the description to be linked to the title it is describing. So later I can do a search on whatever value might be in the description and have the search return the disk label and title that has that value linked to it. If that made any sense. I have been playing around with Access and I can create a table that has a bunch of title and description fields but I can't see any way to link the description with the title. Also want to be able to set it up so when I view the data later or print up reports, and the disk only has one title on it, it will only show that title and the description for it and not a bunch of empty fields along with it. Little aggravating cause I used to do this kind of thing all the time but that was over 7 years ago and I have forgotten how to do all of this. Thanks for any help you can give. Mitch |
|
#2
|
||||
|
||||
|
Quote:
![]() You described a classic relational database model which is ideally suited for Access. You described a one-to-many relationship, that is, one CD may have "many" (zero or more) Titles. You need two tables: one representing CDs and one representing Titles. Every relational table needs a unique Primary Key field. "Unique" means that no 2 records in the table are allowed to have the same value in that field. The "many" table (Titles) will also have a Foreign Key field, which will contain the value of the CD Primary Key on which that Title is stored. So your tables will look like this: Code:
tblCDs:
CDid Autonumber (PK)
DiskLabel Text
Source Text
tblTitles:
Tid Autonumber (PK)
CDid Number (Long Integer) (FK)
Title Text
Descrip Text
Autonumbers are assigned by Access as you add each record, so they are guaranteed to be unique within a table. They are used by the database software and should be of no concern to humans, except to use them to link data in tables. With this arrangement, you can now look up a Title and it will link to the record in the CD table. A CD can have as many Titles as you want, it doesn't matter. Fortunately, you can design Access forms that automatically create the Foreign Key in new Title records, by selecting which CD the Title is stored on. The details are too lengthy to try to explain that here. You should go through a tutorial to learn how to do that. There are many good tutorials online. Check out the list of Access Tutorial Videos posted as the first sticky post in this forum.
__________________
Experience is the thing you have left when everything else is gone. |
|
#3
|
|||
|
|||
|
Thanks Don, that jogged my memory quite a bit. Like I said before I used to work with databases a lot but that was a while ago and I am surprised at how much I have forgotten.
Think I am on the right track though, will check out those videos you recommended and I think I will be set. Thanks again, Mitch |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft Access Help > Need help creating an Access Database to keep track of items. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|