Drew Wutka
DWUTKA at Marlow.com
Mon May 19 13:23:55 CDT 2008
I've never timed them, but they are pretty quick. What's nice about collections is that you have 2 keys you can go off of to retrieve an element. You have the position (and collections are 1 based), so you can retrieve: Set MyObject=MyCollection(1000) And you have the index you can set on your own, which must be unique and a string, so you can use: Set MyObject= MyCollection("ID:25"). I use that all the time, when I use a Data Class with a Collection class. The Data Class Objects are stored as : MyCollection.Add obj, "ID:" & obj.ID , and in most cases, that ID is an Autonumber field and/or the primary key for the relevant record. Drew -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Heenan, Lambert Sent: Monday, May 19, 2008 11:26 AM To: 'Access Developers discussion and problem solving' Subject: Re: [AccessD] Max rows columns in an array You may be right that huge arrays are slow to manipulate when you need to use Redim Preserve (never had to find out myself), but is that disadvantage at least partly offset by the speed with which one can access an element in the array? How do Collections compare with Arrays for random access to the elements? I'm pretty sure that a linked list will be on the slow side, but not sure about Collections. Lambert -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Michael R Mattys Sent: Monday, May 19, 2008 12:15 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Max rows columns in an array I've never heard of it. However, long before you've reached theoretical limits, you'll have switched over to collections or linked lists. Redim Preserve on a large array is like manipulation of a 500 mb bitmap with limited RAM. Michael R. Mattys MapPoint & Access Dev www.mattysconsulting.com ----- Original Message ----- From: "jwcolby" <jwcolby at colbyconsulting.com> To: "Access Developers discussion and problem solving" <accessd at databaseadvisors.com> Sent: Monday, May 19, 2008 11:48 AM Subject: [AccessD] Max rows columns in an array > Does anyone know what the maximum row / column size is in a VBA Array? > Is it an Integer or a Long integer? > > -- > John W. Colby > www.ColbyConsulting.com > -- > AccessD mailing list > AccessD at databaseadvisors.com > http://databaseadvisors.com/mailman/listinfo/accessd > Website: http://www.databaseadvisors.com > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com The information contained in this transmission is intended only for the person or entity to which it is addressed and may contain II-VI Proprietary and/or II-VI Business Sensitive material. If you are not the intended recipient, please contact the sender immediately and destroy the material in its entirety, whether electronic or hard copy. You are notified that any review, retransmission, copying, disclosure, dissemination, or other use of, or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited.