IT tutorials
 
Office
 

Microsoft Access 2010 : Using Forms to Enter and Edit Table Data (part 2) - Using a Form to Delete Records from a Table

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 4.1.0.56 – Licence Key / Serial Keys
1/5/2013 5:12:00 PM

3. Using a Form to Delete Records from a Table

Before you can delete records, you must first select them. I therefore cover the process of selecting records before I cover the process of deleting records.

To select a record, you just click the gray record selector button to the left of a record within a form (see Figure 3). Access selects the record.

Figure 3. The gray selector button.

To select multiple records (when the form is in Continuous Forms view or Datasheet view), you click and drag within the record selector area. Continuous Forms view enables you to view multiple rows of data in a form at a time. Access selects the contiguous range of records in the area over which you click and drag. As an alternative, you can click the selector button for the first record you want to select, hold down the Shift key, and then click the selector button of the last record that you want to select. Access selects the entire range of records between the two selector buttons. Figure 4 shows the Orders table, with three records selected.

Figure 4. The Orders table, with three records selected.

If you want to select a single record when the cursor is within the record, you can simply choose Select from the Find group on the Home tab of the Ribbon. Then choose Select from the drop-down menu.

Delete a Record

When you know how to select records, deleting them is quite simple. The process is almost identical to that of deleting records in a datasheet:

1.
Select the record you want to delete.

2.
Press the Delete key. A dialog box appears, asking whether you’re sure you want to delete the records (see Figure 5).

Figure 5. A dialog box that asks if you want to delete the selected records.

3.
Click the Yes button.

Delete Records from Tables with Referential Integrity

The process of deleting a record is not so simple if you have established referential integrity between the tables in a database and the row that you are attempting to delete has child rows. You can think about the fact that customers generally have orders associated with them, and those orders have order detail records associated with them. The relationship between the Customers table and the Orders table prohibits the user from deleting customers who have orders. Here’s how you delete a customer who has orders:

1.
Select the records you want to delete.

2.
Press the Delete key. A dialog box appears, saying that the record cannot be deleted or changed because the table includes related records (see Figure 6).

Figure 6. Access notifying you that you cannot delete the selected records.

3.
Click OK to close the dialog box.

Access provides a referential integrity option with which you can cascade a deletion down to the child table. This means, for example, that if you attempt to delete an order, Access deletes the associated order detail records. If you establish referential integrity with the cascade delete option, the deletion process works like this:

1.
Select the records you want to delete.

2.
Press the Delete key. A dialog box appears, asking whether you are sure you want to delete the records (see Figure 7).

Figure 7. Access asking whether you want to delete the parent row and the associated child records.

3.
Click Yes to complete the deletion process.
 
Others
 
- Microsoft Access 2010 : Using Forms to Enter and Edit Table Data (part 1) - Moving from Record to Record in a Form, Undoing Changes Made Within a Form
- Microsoft OneNote 2010 : Using Page Templates
- Microsoft OneNote 2010 : Working with Subpages
- Microsoft Visio 2010 : Printing Basics (part 2) - Print Preview, Experimenting with Printing Without Wasting Trees
- Microsoft Visio 2010 : Printing Basics (part 1) - Printing from the Backstage Area
- Microsoft Visio 2010 : Running Computer and Network Reports, Searching and Replacing Text
- Microsoft Project 2010 : Documenting Work Package Details
- Microsoft Project 2010 : Setting Up Custom WBS Codes
- Microsoft Project 2010 : Documenting a WBS in Another Program
- Upgrading and Converting to Access 2010 : ENABLING A DATABASE, ACCESS 2010: 64-BIT CONSIDERATIONS
 
 
Top 10
 
 
Facebook
 
Technology FAQ
- Microsoft ebs security server configuration
- IIs7 on Windows server 2003
- How to Configure Failover Clusters With Win 2008 Server R2?
- Windows 2008 Network Load Balancing
- Windows Server 2008 - Group Policy Management - Remove Computer Management
- Remove shortcuts possibility in a web page or to put in favorite
- HTA Dynamic Drop Down List
- IIS host header and DNS
- VMware or MS Virtual Server?
- Adobe Acrobat 9 inserting tab pages
programming4us programming4us