Creating User Prompts in Access 2007
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Summary: Learn how to display a custom dialog box in Microsoft Office Access 2007 to prompt users to confirm changes before saving a record.
Applies to: 2007 Microsoft Office System, Microsoft Office Access 2007
Joel Krist, Akona Systems
May 2007
![]() In Microsoft Office Access 2007, by default, users are not prompted to confirm changes after modifying and saving records on a form. But often you might want to prompt users to confirm their changes before the record is saved. You can use a BeforeUpdate event procedure to display a confirmation prompt and handle a user's response to either cancel or continue with the save. This visual how-to topic illustrates how to display a custom dialog box to prompt users to cancel or continue with saving changes to a record. ![]() To illustrate this process, this section describes the following steps:
Adding a BeforeUpdate Form Event Procedure The first step is to load the form and display it in Design View. Then you add the BeforeUpdate form event procedure to the form. To add the event procedure
Adding Code to the BeforeUpdate Event Procedure The next step is to modify the Form_BeforeUpdate event procedure so that it uses the MsgBox function to prompt the user to confirm changes and save a record in the form. The following code checks the return value from the MsgBox call. If the user responds No to the confirmation, the code sets the Cancel argument that is passed to the event procedure to True, which tells Access to cancel the record save.
![]() Frequently you want users to confirm that they want to save changes to records that they have modified in Access 2007 forms. You can use a BeforeUpdate event procedure to display a confirmation prompt and handle a user's response to either cancel or continue with the save. The key steps in this process are as follows:
|
![]() ![]() Video Length: 00:03:32 File Size: 2.37 MB File Type: WMV ![]() |