Microsoft Access 2010 Bible

(Rick Simeone) #1

Chapter 12: The Access Event Model


463


FIGURE 12.4

Specifying an event procedure for a report’s Detail section


In addition to the NoData event, other report events are frequently programmed. Figure 12.5
shows how to add code to a report’s Format event to control the visibility of controls on the
report.

FIGURE 12.5

Running an event procedure to display or hide a control on a report


The Detail0_Format event procedure illustrated in Figure 12.5 first checks the value of the
txtQtyInStock control. If the value of txtQtyInStock is less than 10 , lblLowStock is dis-
played; otherwise, the warning control is hidden.

You’ll see many examples of using events and event procedures to manipulate forms, reports, and
controls throughout this book.
Free download pdf