• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Understanding Objects > Working with Events

Working with Events

There’s one more part of working with objects that you haven’t read about yet: dealing with events. You’re probably familiar with events from working in the Access user interface. Events provide “hooks” that let you run your own code when something happens. For example, buttons have a Click event, and when the user clicks a button in your application, you can run a macro in response.

However, it turns out that running macros in response to events is a shortcut invented by the Access team to make it possible to construct reasonably complex applications without writing any code. Most professional developers avoid the use of macros for several reasons (notably that macros do not implement any error trapping). Instead of using macros to respond to events, you can use event procedures, which are special pieces of VBA code.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint