3.1 An example

1Private Sub Form_BeforeUpdate(Cancel As Integer)   
2  If ([Country/Region].Value = ”USA”) And _   
3      Not ([Zip/Postal Code].Value like ”#####”) Then 
4    Cancel = True  
5  End If   
6End Sub 

This is a handler of the “Before Update” event. The name of the subroutine is Form_BeforeUpdate. The conditional statement is the “body” of the subroutine. In this case, this subroutine is invoked from an invisible part of the application.

Several important points should be noted.