The information in this article applies to:
Advanced: Requires expert coding, interoperability, and multiuser skills. This article applies only to a Microsoft Access project (.adp). SYMPTOMS
When you delete records in a form in a Microsoft Access project (.adp), the order of events is different than when you delete records in a form in a Microsoft Access database (.mdb). BeforeDelConfirm-->AfterDelConfirm-->DeleteIn a Microsoft Access database, the order of events when you delete records in a bound form is as follows: Delete-->BeforeDelConfirm-->AfterDelConfirm CAUSEMicrosoft intentionally changed the order of deletion events in an Access project in order to avoid opening unnecessary transactions on Microsoft SQL Server. MORE INFORMATIONAn Access project issues commands to Microsoft SQL Server within transactions. In order to avoid opening unnecessary transactions on SQL Server, Microsoft Access prompts you to confirm the deletion before opening the transaction. If you confirm the deletion, Access opens a transaction on Microsoft SQL Server, issues the DELETE statement to delete the record(s), and fires the form's Delete event. If you click No when prompted to confirm the deletion, Microsoft Access does not open a transaction on Microsoft SQL Server to delete the record and does not fire the form's Delete event. The following sections explain these events in more detail. BeforeDelConfirm EventThe BeforeDelConfirm event fires just before Access prompts you to confirm the deletion. The only exception to this is when you clear the Record Changes check box on the Edit/Find tab of the Options dialog box, available by clicking Options on the Tools menu. If you cancel the BeforeDelConfirm event, Access does not display the confirmation dialog box but still fires the AfterDelConfirm event afterwards.AfterDelConfirm EventThe AfterDelConfirm event fires after Access has prompted you to confirm the deletion, or if the BeforeDelConfirm event is cancelled. The only exception to this is when you clear the Record Changes check box on the Edit/Find tab of the Options dialog box, available by clicking Options on the Tools menu.Delete EventThe Delete event fires after the AfterDelConfirm event, except in the following situations:
Steps to Reproduce BehaviorCAUTION: Following the steps in this example will modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and perform these steps on a copy of the database.
Note that the Delete event fires, followed by the BeforeDelConfirm and AfterDelConfirm events respectively. REFERENCESFor more information about the order of events, click Microsoft Access Help on the
Help menu, type "order of events" in the Office Assistant or the Answer Wizard,
and then click Search to view the topics returned. Additional query words: prb
Keywords : kbdta AccessCS |
Last Reviewed: July 9, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |