• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 27. Understanding the Data Acces... > Understanding Objects and Object Col...

Understanding Objects and Object Collections

Access 97, like other members of the Office 97 productivity software suite, organizes programmable objects into a hierarchical structure of classes of objects. Two members of Access object classes that you have used extensively are Forms and Reports. You use these class names as identifiers, such as Forms!FormName. PropertyName and Reports! ReportName!ControlName.PropertyName, in expressions. In these expressions, Forms or Reports is the class name, and FormName or ReportName is the literal name of the member object of the class.

Groups of objects from the same class are called object collections. Forms is the collection of open Form objects, and Reports is the collection of open Report objects. Unopened objects do not appear in these collections. Collections are similar to arrays, except that collections consist of references (called pointers) to member objects. On the other hand, Access VBA arrays consist of elements with assigned values. Unlike arrays, collection members may appear or disappear without your intervention. As an example, the members of the Forms collection change as you open and close the Form objects of your application. Access 97 is also capable of creating user-defined collections with the Dim colUserDefined As New Collection statement. You then add user-defined objects to the collection by invoking the AddItem method of Collection objects.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint