DEEP-object concept – Dynamic External Event Processing objects
(an introduction for advanced MS Access 97/VBA/VB developers)

Shamil Salakhetdinov
e-mail:
shamil@marta.darts.spb.ru
All rights reserved. Terms of use.

Written in September, 1998

Originally published on http://www.wji.com/access in September 1998
(www.wji.com/access is down now)

SUMMARY

This article provides an introductory information on how to implement simple DEEP-objects in MS Access 97. DEEP-object is an instance of a custom class bound on run-time to the events of forms, reports and/or their controls. DEEP-object is a way to implement “codeless” yet flexibly customizable forms and reports, create highly reusable inter-application generic and specific custom classes/object code repositories, design, develop and simulate visual layer OLE-servers in MS Access and easily convert/transform them into VB ActiveX DLLs and much more…

MORE INFORMATION

This article presents the following topics:

Publications of using WithEvents-feature in MS Access 97

DEEP-object uses WithEvents-feature of MS Access 97. This feature is poorly described in MS Access 97's online help and technical publications. First public announcement/example of using WithEvents-feature with MS Access 97 visual layer objects I know can be found using this URL (Access-L discussion list archive):

http://peach.ease.lsoft.com/scripts/wa.exe?A2=ind9807D&L=access-l&P=R831

This was a key information I used to find DEEP-object concept as a result of the discussion:

http://peach.ease.lsoft.com/scripts/wa.exe?A2=ind9807C&L=access-l&P=R21471
http://peach.ease.lsoft.com/scripts/wa.exe?A2=ind9807C&L=access-l&P=R21833
http://peach.ease.lsoft.com/scripts/wa.exe?A2=ind9807C&L=access-l&P=R26661

Code Behind Form

Code Behind Form – AKA CBF – is a class module bound to form or report. Since MS Access 2.0 CBF was primarily used to write a code processing events of forms, reports and their controls. MS Access 97 introduced the possibility to create custom class modules separated from forms and reports and extended the concept of CBF allowing to use it to create true custom objects with public properties (get, let and set), methods, encapsulated data and visual layer mock-up – form or report layout.

Limitations of Code Behind Form

CBF is a great concept/feature but it has an obvious limitation – programmer has to bind event processing code to the events on design time. This limitation leads to the usage of code templates and trivial but not easy additional work programmer/utility have to do in the case of template code modifications.

Sample “standard” CBF

In this section you'll find sample "standard" CBF which processes form's and its combo-box's events to navigate in bound form. To use this code you have to:

Note: All the code in this article is written without error-handling etc. bullet-proofing techniques to not loose the main subject – DEEP-objects – behind dozen of code lines. Non-traditional usage of Form default object variable in CBF instead of standard Me object variable isn't necessary but it saves you time when you move CBF into custom class module – you can easily find other similar techniques.

DEEP-object – conceptual code to create it
Object wrapper module
“Codeless” form
Another way to create and use DEEP-objects
Some of DEEP-objects concept applications

This article seems to be just an introduction to a lot of articles, discussions, sample code, applications and even books which can be written to investigate/use DEEP-object concept. Here are some obvious application areas of it:


DEEP-objects can be used in VB 5.0 too but this is a little bit another story/code.

CONCLUSION

I don't think that DEEP-object concept is an absolutely new concept for Object Oriented and Event-driven programming in general but it seems to be a brand-new concept for VBA (at least MS Access 97 VBA) programming. Please correct me if I'm wrong.

Click to download sample database (deepcnpt.zip - 29286 bytes)


HOME

Copyright (c) 1998,1999 by Shamil Salakhetdinov.
All rights reserved. Terms of use.

Last updated: June 4, 1999