This project is read-only.

Using the Composite Controls Object Model in a VBA Project

Using the object model in a VBA project requires that the necessary VBA code modules be added. This includes the support modules and class modules.

After including these modules, it is recommended that an instance of the cCompositeControls class is instantiated at a module level (i.e., a "Startup" module) before forms using composite controls are opened.

Once the cCompositeControls class has been created and initialized, the parent form can start creating controls directly in it's Load event. This is typically managed by referencing custom methods of the cCompositeControls object that create the composite controls required.

Initialization parameters for composite controls are also specified when the controls are created. There is no form-level code to deal with object destruction. The cCompositeControlManager and cCompositeControls objects manage this automatically.

View the Access Database Demo Project for a detailed example.

The code modules employ the following naming conventions:

Support modules

These are standard modules whose names begin with "Support_". They contain code specific to the classes, or general functions, enumerations, constants and other global elements shared across classes. An example list derived from the Access Database Demo Project are listed below ("core" modules required in all projects are indicated with asterisks):

Support code for the Binder composite control and cControlChild class
General module of functions acting as callback functions used with the cControl_EventHandler classes.
Support code for the WebButton composite control
General functions used throughout the classes in the Composite Control object model.
Globals (non-functions) used throughout the classes in the Composite Control object model.
Support functions for the cControlManager class. cControlManager is a required component of the basic objecct model.
Support functions for the cControl_EventHandler class. Usually a required component for any composite control implementation.
Class Modules


Last edited Dec 31, 2010 at 3:19 AM by vba_junkie, version 3


No comments yet.