>Thanks Phillip. Actually i was already using the Forms colelctions to loop through when accsesing the forms. I went brain dead though because I didn't realize that using a Form variable was the same thing I needed to do to fix the problem of addressing controls on different instances. Why do you say tht itterating through collections is slower then arrays? Are they not essentially the same thing when looping? Or is it possible to reference indexes in arrays?
Hi Jason,
Collections are usually overlooked, especially in terms of performance. You are right that a collection is essentially an array, but it has a little more more overhead. The additional baggage makes them slower than simple arrays of object references.
Bring in a VB application tuning expert and one of the first things they'll look for are large, misused collections. That said, collections are easier to code against. When iterating through collections, you can speed things up by using an iterator enum with the For...Each construct instead of just using the For...Next loop. For..Each is 100%-250% faster than For...Next on large collections (several thousand member objects and higher).
HTH,