Page 60 - AIS access_chang_ingraham
P. 60
58 CHAPTER 4 SALES/COLLECTION BUSINESS PROCESS
Create a Relational Database for Tragg's Following the REA Diagram
To start with a relatively simple design of a database, we will not create tables for those
entities in dotted lines in Figure 4-1. In addition, as noted in the model, the relationship
between entities Sales and Inventory is many-to-many. We do this because it is possible
that we will have several of one particular kind, size, and color surfboard in stock at one
time. These then can be further customized for customers in some way, if requested, or
sold as is. Therefore, as you learned in Chapter 2, we cannot use a foreign key link to join
these entities. You need a separate table to represent each many-to-many relationship.
Accordingly, Tragg's table structure for the Sales/Collection Business Process can
be represented as follows:
Cash Table (CashAcctNo, AcctType)
Inventory Table (InventoryID, InventoryDescription, InventoryCost, InventoryPrice)
Extras Table (ExtrasID, ExtrasDescription, ExtrasCost, ExtrasPrice)
Cash Receipt Sale Table (CashReceiptID, InvoiceNo, AmountApplied)
Sales Inventory Table (InvoiceNo, InventoryID, QuantityOrdered, ExtrasID)
Cash Receipt Table (CashReceiptID, CRDate, CustomerCheckNo,
CustomerID, CashAcctNo)
Sales Table (InvoiceNo, InvoiceDate, CustomerID)
Customer Table (CustomerID, CustomerLastName, CustomerFirstName,
CustomerAddress1, CustomerAddress2, CustomerCity, CustomerState,
CustomerZip, CustomerPhone)
Creating Tragg's Relational Database Using Access Open the Chapter 4
database for Tragg's Custom Surfboards. Note that all the tables, some relationships, and
some forms have already been created for the Sales/Collection business process. Take some
time to examine the tables, forms, and the relationships that have been created thus far.
The Sales Form: Creating a Form
with a Subform
Creating a Sales Form is a more complex task than creating the forms we have worked with
in Chapter 3. After creating the Sales Form, we will be able to enter data into the Sales Table
and the Sales Inventory Table at once. In addition, when we create the Sales Form, we will
need data from the Customer Table, Inventory Table, and the Extras Table. Therefore,
there must be data in these tables prior to creating a Sales Form. Open the Tragg's Custom
Surfboard database and take some time to acquaint yourself with the Customer Table,
Inventory Table, and the Extras Table. In addition, since creating the Sales Form is for
entering data into the Sales Table and the Sales Inventory Table, we will need to establish
the necessary relationships between all five tables before we create the fmID.
1. Click on the Relationships . : icon to open the Relationships window.
2. Click on Show Table ...

