Hi All,

This is a great tip I got from the MSDN CD. I thought it was so good I should
share it with everyone.

Everyone generally uses code like this:

Dim recTemp as New ADODB.RecordSet
recTemp.Open "SELECT * FROM tblABC",cnxMain,yada yada
While not recTemp.EOF
list1.AddItem recTemp!Name
recTemp.MoveNext
Wend

But this can be sped up significantly by getting a reference to the required
field(s) before hand. In the first example VB searches throught the fields
collection once for every record but in the second VB only does this once
no matter how many records.

Dim recTemp as New ADODB.RecordSet
dim fldTemp as ADODB.Field
recTemp.Open "SELECT * FROM tblABC",cnxMain,yada yada
set fldTemp=recTemp.Fields("Name")
While not recTemp.EOF
list1.AddItem fldTemp.Value
recTemp.MoveNext
Wend

I tested this and got 3.2 secs the first way and 1.9 the second way.

Michael Culley