[AccessD] When is a collection not a collection?

John Colby jwcolby at ColbyConsulting.com
Tue Oct 25 12:55:12 CDT 2005


You can iterate the collection just fine

Dim prp as dao.property
	for each prp in MyObject.Properties
	Next prp



John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Jim DeMarco
Sent: Tuesday, October 25, 2005 1:47 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] When is a collection not a collection?


Can you declare it a Variant and access the collection?

Or... dim a collection then loop through the Properties collection and
populate your collection manually?  A custom collection class may serve you
better to preserve name/value pairs though.

Jim DeMarco

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of John Colby
Sent: Tuesday, October 25, 2005 1:41 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] When is a collection not a collection?


When it is a properties collection?

Try dimming a collection

Dim lcol as collection

Then try setting that collection to any DAO object's properties collection:

	set lcol = MyFld.Properties

Or 	
	set lcol = MyTDF.Properties

You will get a run time error: "Type Mismatch"

Sigh.

AFAICT, all of the other object collections in the database container - the
tabledefs, fields, forms etc are all true collections, i.e. you can dim a
collection and save a pointer to these object collections in your
collection.  Not so with the Properties collection of any object.

Sigh.

The properties collection has different properties and methods:

Append 
Count 
Delete
Refresh

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


 



****************************************************************************
*******
"This electronic message is intended to be for the use only of the named
recipient, and may contain information from Hudson Health Plan (HHP) that is
confidential or privileged.  If you are not the intended recipient, you are
hereby notified that any disclosure, copying, distribution or use of the
contents of this message is strictly prohibited.  If you have received this
message in error or are not the named recipient, please notify us
immediately, either by contacting the sender at the electronic mail address
noted above or calling HHP at (914) 631-1611. If you are not the intended
recipient, please do not forward this email to anyone, and delete and
destroy all copies of this message.  Thank You".
****************************************************************************
*******

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list