Event Procedures

After placing a control on the form or report design surface, a user can view the code behind the form by selecting the View | Code menu item. Select the control name in the left-hand side Object dropdown in the code window, and each of the event procedures listed in the right-hand side Event Procedure dropdown. In addition to the event procedures exposed by the control through its type-library, the extender-object that Access wraps around the custom control also exposes a few event procedures as well. These events are Enter, Exit, GotFocus, LostFocus, and Updated. Currently, there is a bug that will cause a GPF if you attempt to build an event procedure for a control that contains an event name that conflicts with one of the five extender-object event names.

Verify that the parameter types are correct for each of the event procedures. For some parameter types, Access will convert to the keyword object. For example, if your event procedure has a parameter of type Node that is defined (for an example, see the Visual Basic TreeView ActiveX Control's Expand event) in the control's type-library, Access will build the event procedure as:

 

Private Sub ActiveXCtl1_Expand(ByVal Node As Object)

 

This is a slightly different behavior than you'll see building the same event procedure for the control in Visual Basic 5.0:

 

Private Sub TreeView1_Expand(ByVal Node As ComctlLib.Node)

 

Or, in Visual Basic 4.0 as:

 

Private Sub TreeView1_Expand(ByVal Node As Node)

 

Regardless, you'll see some variation here, so make sure your control's event procedures work correctly with non-standard types and that the correct parameter passing convention is used based on your expectations.