One of the most important things to remember when working with events in VBA is the order in which events occur. For example, when you save a record on a form, several events occur, one after another. By looking at the list of events on the property sheet, try to work out the order in which they happen.
Take some time to read through the list of events and their uses. You will find that some events are more useful than others in other words, you will find yourself writing custom event handlers for some events more often than for other events. Look at the list and try to think about which events you would most commonly handle with custom event handlers.
We saw how to use the On Undo event to help guard against user error. Hopefully, you should already be thinking of other ways to foolproof the application even if you are not sure how to actually code them. What would happen if the user closed the form halfway through adding a new record? Code a new dialog to ask the user to confirm that they really wish to exit the form.
Hint: you can use the Form Unload event to detect when the user has attempted to exit the form.