Courses/Computer Science/CPSC 203/CPSC 203 Template/Fall 2009 Teaching Assistants/F09 Thomas Burt/Lab 2.2
From wiki.ucalgary.ca
								< Courses | Computer Science | CPSC 203 | CPSC 203 Template | Fall 2009 Teaching Assistants | F09 Thomas Burt
												
				Contents
Store.accdb
Please download the new database file from http://pages.cpsc.ucalgary.ca/~teburt/Store.accdb
One-To-Many Relationships
Scenario
Many of our products have a long list of features. They are stored as a comma separated list. When we first had our store website built, the designer became irate at the sight of commas and instead displayed them in a bulleted list. However, now whenever we forget a comma, the features merge into one another and it's a big pain. We want to make it so product features are easier to maintain.
Related Table
To accomplish this, we're going to change our Product.features field from a text into a list. This will take two steps:
- Adding a new table called Product Features
 - Creating a new sub-form on our Product form
 - Migrating the commma-separated values into the new table
 
We'll put off step #3 unless we have time at the end of the tutorial (it's a real pain and you won't need to know how to do it).
Create Table
- Create a new table called Product Features
 - Create two fields:
- "Feature Text" > Text
 - "Product" > Lookup...
 
 - Create a new form for Products
 - Add a subform that is linked to the Product Features table.