Udostępnij za pośrednictwem


Setting Event Handlers on ActiveX Controls

ActiveX controls can be programmed to respond to events. You can use ControlEvents in properties to view the events that are available in a control and to create event handlers. Event handling is commonly done to trap changes in the data source query. Changes include:

  • Implementing a lookup. When a control (like a DBCombo box) changes value, the change event is trapped to update a data control's query.

  • Implementing a master detail relationship. Two data controls are added to a dialog box, one for the master portion and a second for the detail portion. Whenever the first data source changes, the second data source's query is updated through an event handler.

  • Trapping errors. Most controls have an error event from which you can write an error handler (see Error Trapping).

For more information, see Mapping Messages to Functions.

See Also

Reference

Using ActiveX Controls