Making an Object Variable Refer to an Existing Item

Just as you can use the Set keyword to retrieve a reference to a new object, you can use it to retrieve a reference to an existing object. If objItem is an object variable that refers to an existing member of a class, you can use code like this to make objNewItem refer to the existing item:

Set objNewItem = objItem

After this statement, objNewItem and objItem refer to the same object.

© 1997 by SYBEX Inc. All rights reserved.