1.2.3 Deleting Rows

You can remove a book from the table by highlighting a row (click in the cell just to the left of a call number) and then press the Delete key on the keyboard:


Figure 1.12: Delete a record: select, press delete


When you press the Delete key MS Access will respond in one of two ways depending on whether or not there is an existing reference to the row you are trying to delete:

A reference to the book does not appear in the Loan table:

                    Figure 1.13: Prompt message

A reference to the book does appear in the Loan table:

                                Figure 1.14: Prompt message

When you view the Loan table you can see the books that library members have taken out and whether a book has been returned. Rows in the Loan table have references to rows in the Book table and to rows in the Member table. The default action in MS Access is that a deletion is disallowed if there is some row in a table that has a reference to it. So, we cannot delete a book if there is a Loan row referencing it.

We have briefly shown how to modify, add and delete data in tables. Next, we introduce the design perspective for tables.


Share This Book