OpenOffice.org OpenOffice - 3.3 Guide de démarrage rapide Page 213

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 379
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 212
Adding data to the list table
List tables do not require a form. Instead, add their data directly to the table. In this
example, use the names of the two people with a bank card and Cash for cash
purchases.
1) In the main database window, click on the Tables icon (Figure 175). In the list
of tables, right-click on Payment Type and select Open from the pop-up menu.
a) Enter Dan in the Type column in the first row. Press the Tab key to move
to the second row. Notice that the PaymentID value for this row changes
from <AutoField> to 0.
b) Enter Kevin in the second row. The PaymentID changes to 1.
c) Enter Cash in the third row. The PaymentID changes to 2.
2) Save and close the table window.
Tip
You can also use the Enter key to move from entry field to entry field, or
use the down arrow key to move from row to row.
Defining relationships
Now that the tables have been created, what are the relationships between our
tables? This is the time to define them based upon the questions we asked and
answered in the beginning.
When on vacation, we want to enter all of our expenses all at one time each day. Most
of these expenses are in the Vacations table, but the fuel we buy is not. So, we will
relate these two tables using the Date fields. Since the Fuel table may have more
than one entry per date, this relationship between the Vacations and Fuel tables is
one to many. (It is designated 1:n.)
The Vacations table also contains several fields for the type of payment used. For
each field listing the payment type, there is only one entry from the Payment Type
table. This is a one to one relationship: one field in one table to one entry from the
other table. (It is designated 1:1.) Other tables also contain fields for the type of
payment. The relationship between the fields of those tables and the Payment Type
table are also 1:1.
Since the Payment Type table only provides a static list, we will not be defining a
relationship between the Payment Type table and the fields of the other tables which
use the entries of the Payment Type table. That will be done when the forms are
created.
The Fuel and Maintenance tables do not really have a relationship even though they
share similar fields: Date and Odometer.
Tip
As you create your own databases, you need to also determine where
tables are related and how.
1) To begin defining relationships, choose Tools > Relationships. The
Automobile – OpenOffice.org Base: Relation Design window opens and the Add
Tables dialog pops up. (You can also open it by clicking the Add Tables icon on
the Relation Design window.)
2) On the Add Tables dialog, use either of these ways to add a table to the
Relation Design window:
Chapter 8 Getting Started with Base 213
Vue de la page 212
1 2 ... 208 209 210 211 212 213 214 215 216 217 218 ... 378 379

Commentaires sur ces manuels

Pas de commentaire