Share this Page URL

Part 5: Automating an Access Application > Understanding Event Processing - Pg. 671

671 Chapter 21. Understanding Event Processing Access as a Windows Event-Driven Application Summary of Form and Report Events Understanding Event Sequence and Form Editing Summary of Macro Actions The Macro Design Facility--An Overview 713 715 728 731 745 Although you can make Microsoft Access do a lot for you by setting properties when you design forms and reports, you really can't make your application "come alive" until you build macros or Visual Basic procedures that respond to events . An event can be as simple as the user clicking a button--and your code responds by opening a related form or report. An event can also trigger complex actions, such as creating a booking record when the user selects an available room. In this chapter, you'll first learn what event processing is all about--both in Windows and specifically within Access. The middle part of the chapter contains a comprehensive reference for all the events available within Access, a discussion of event sequence, and a list of the specific macro actions you can use to respond to events. The final part of the chapter gives you an overview of the macro design facility and shows you a few examples of an application automated with macros. Note The examples in this chapter are based on the WeddingMC.mdb sample database on the companion CD included with this book. The results you see from the samples in this chapter might not exactly match what you see in this book if you have changed the sample data in the files. Also, all the screen images in this chapter were taken on a Windows XP system with the display theme set to Windows XP. Your results might look different if you are using a different operating system or a different theme. Access as a Windows Event-Driven Application If you're reading this book, you're using Microsoft Office and Microsoft Windows. You probably use Windows every day and don't give a second thought to how it actually works. Understanding Win- dows is essential to programming events in Microsoft Access. Understanding Events in Windows Microsoft Windows is an event-driven and message-based operating system. When you start an application on your system, that application sends messages to Windows to tell Windows that it wants to respond to certain events. When an event occurs (such as moving your mouse over the application window or clicking somewhere), Windows sends a message to the application to notify