What is the purpose of sub-form?

  • Thread starter Thread starter Guest
  • Start date Start date
Hi, Jen.

A subform is usually used to display the many side of a
one-to-many relationship, e.g., to show all the orders
placed by a certain customer. A main form based on
Customers with an embedded subform based on Orders might
look like:

<main form>
CustomerID: 40403
CustomerName: FlyWheels R Us
Location: Philadelphia, PA

<start of subform>
Orders
------
OrderNumber Date Salesperson
11111 1/1/01 KS
11315 2/5/03 JT
20202 6/1/04 LK

HTH
Kevin Sprinkel
 
So that data in one field is not duplicated many times.
Example: Suppose you had a record company with several
artists, and wanted to keep a database of all record
companies and there artists, would you want to enter the
name of the company each time you entered an artist for
that company. Suppose there were a 100 artists from RCA,
would you want to list RCA 100 times, or once.

To do this, create a table, then create field and call it
RECCOMPANIES, and save. When it ask about primary key,
choose yes, and give table a name.

Now, create a second table and in first field, call it
ARTISTSID, and in data type choose number. This is how you
link the subtable with maintable when you create forms,
then pull in ARTIST form in main form. It will ask you
what fields to link, choose RECOMPANIESID and ARTISTSID.

This will show you the value of subforms. Some things just
want work without them. Learn how to create and use them!

C ya!
 
Back
Top