15.2. Using Events to Control Forms

This section discusses how to use the events that VBA supports for user forms and for the individual controls to give yourself fine control over how your user forms look and behave.

So far in this chapter, you've used three of the most useful events:

  • You used the Initialize event to add items to list boxes just before a form is loaded and to adjust the number of tabs on a tab strip.

  • You used the Click event to take action when the user clicks a particular control in a user form. So far you've been using Click mostly for command buttons, but you can use it for just about any control — including the user form itself.

  • You used the Change event to control what happens when the user changes the tab displayed on a ...

Get Mastering VBA for Microsoft Office 2007, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.