ADO exposes a set of events from its Connection and Recordset objects. These events are fired so you can attach code to be executed when something occurs on the object. For example, a MoveComplete event is fired on the Recordset object whenever a record is navigated.
To add code to an ADO Connection or Recordset event
-or-
Right-click a Connection or Command object and click View Code on the shortcut menu.