Microsoft Access makes it easy to run code in response to an action performed by the user. When you set an event property for a form, report, or control to [Event Procedure], Microsoft Access creates the event procedure template for you. All you have to do is add the code you want to run in response to a particular event on the form, report, or control. For example, you can have code run when a user clicks a command button or changes data.
next to the property box to display the Choose Builder dialog box.Microsoft Access automatically declares event procedures for each object and event in a form or report module by using the Private keyword to indicate that the procedure can be accessed only by other procedures in that module.
Private Sub CompanyName_Change()
Beep
End Sub
The event procedure runs each time the Change event occurs for the object.