The Delete event occurs when you select one or more records for deletion and before the records are actually removed from the table. Use this event to place restrictions on the data that can be deleted. When deleting multiple records, the Delete event occurs for each record. This enables you to confirm or cancel each deletion in your event procedure code. You can cancel the deletion in the Delete or BeforeDelConfirm events by setting the Cancel argument to True.

After the record is deleted, the focus moves to the next record and the Current event for that record occurs.

The event procedure in Hands-On 24-7 demonstrates how to disallow deletion of records when CategoryID is less than or equal to 8 and ask the user to confirm the deletion for other records.

0 0

Post a comment