Class Properties (DAO VBA)

A Properties collection contains all the Property objects for a specific instance of an object. To use a Properties class variable it first needs to be instantiated, for example


Dim prps as Properties
Set prps = Properties

Append

Adds a new Property to the Properties collection.

The appended object becomes a persistent object, stored on disk, until you delete it by using the Delete method. The addition of a new object occurs immediately, but you should use the Refresh method on any other collections that may be affected by changes to the database structure. If the object you're appending isn't complete (such as when you haven't appended any Field objects to a Fields collection of an Index object before it's appended to an Indexes collection) or if the properties set in one or more subordinate objects are incorrect, using the Append method causes an error. For example, if you haven’t specified a field type and then try to append the Field object to the Fields collection in a TableDef object, using the Append method triggers a run-time error.

Append (Object)

Object: An object variable that represents the field being appended to the collection.


Properties.Append Object:=

Count

You can use the Count property to determine the number of items in a specified collection.


Properties.Count

Delete

Deletes the specified Property object from the Properties collection.

Delete (Name)

Name: The name of the property to delete.


Dim strName As String: strName = 
Properties.Delete Name:=strName

Item

Item (Item)

Refresh

Updates the objects in the specified colletion to reflect the database's current schema.

Use the Refresh method in multiuser environments in which other users may change the database. You may also need to use it on any collections that are indirectly affected by changes to the database. For example, if you change a Users collection, you may need to refresh a Groups collection before using the Groups collection. A collection is filled with objects the first time it's referred to and won't automatically reflect subsequent changes other users make. If it's likely that another user has changed a collection, use the Refresh method on the collection immediately before carrying out any task in your application that assumes the presence or absence of a particular object in the collection. This will ensure that the collection is as up-to-date as possible. On the other hand, using Refresh can unnecessarily slow performance.


Properties.Refresh