Automating Microsoft Access with VBA
< Day Day Up > |
All the procedures you've seen so far in this chapter have been located in standard modules. But as you've already seen several times in this book, VBA code can also be associated directly with a form. Every form in your Access application can have its own form module. The form module is saved as a part of the form so that if (for example) you copy the form to another database, the form comes along with it. One type of code that is stored within the form module is the event procedures for the form. These procedures are called when something happens to the form or to a control on the form. For example, clicking a button on a form calls the event procedure associated with the button's Click event. Here's how you can add a Close button to the Clients form:
|
< Day Day Up > |