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

14. Programming DAO: Overview > 14.4. Referencing Objects

Referencing Objects

The first step in understanding the objects in the DAO and Microsoft Access object hierarchies is to understand how to refer to an object in the hierarchy. In particular, we can refer to an object by the name of ObjectName that belongs to a collection named CollectionName, by any of the following syntaxes:

  • CollectionName!ObjectName, or CollectionName![ObjectName] when ObjectName has illegal characters, such as spaces.

  • CollectionName("ObjectName").

  • CollectionName(StringVar), where StringVar holds the string ObjectName.

  • CollectionName(Index), where Index is the index number of the object in the collection. Indexes start with 0 and go up to one less than the number of objects in the collection. (As we will see, the number of elements in a collection is denoted by CollectionName.Count.)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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