cControl_Binder Class

The binder class is useful to filter the data displayed in a control / form based on the values of other controls or specific fields of other forms. That is, a SQL expression is supplied for the data which appears in the binder target's control / form. Then, bindings are added which bind the values / fields of other controls / forms to specific fields found in the target control / form SQL expression.

Thus, one may actively filter the data displayed in a control or form based on the values found in other controls / forms.

The cControl_Binder class provides a "context" in which bindings may act. That is, in order to "bind" a control or form to another control or form, such that the first object (the source) filters the data displayed in the second (the target), a cControl_Binder object must be created which references the target object. Having created the cControl_Binder, cControlChild_Bindings may be added to the binder to bind the source objects to the target.

For example, below is a depiction of the cControl_Binder / cControlChild_Binding objects and how they interact with each other in the binder demo included in the Access demo project:

cControl_Binder Access Demo

The Payitems Subform Binder object provides a context for the six bindings which are used to filter the form data.

There is a binder attached to the "Payitem Sections" combo that provides a context for a binding from the Payitem Categories combo. That is, the sections which are displayed in the Payitem Sections combo depend upon which category is currently selected.

Also note that the two labels which are updated with the payitem paycode and description each have a binder of their own, and are updated by the corresponding field in the subform.

Note that the binding is effective only within the context of the binder to which it is attached.

cControl_Binder Object Members

Last edited Jan 13, 2011 at 6:18 AM by vba_junkie, version 5


No comments yet.