From: rquintal on
On Oct 19, 6:22 pm, JustBoo <B...(a)boowho.com> wrote:
> Access 2003 Listbox.AddItem w / 5 Columns Is Incredibly Slow
>
> As one can see from the function / code below I create a recordset
> with 5 returned columns and "pump" those values into an Access 2003
> listbox.
>
> The SQL statement and resultant recordset I use returns (runs) in less
> than two (2) seconds for around 260 records returned. If I add the
> line below into the loop:
>
> Me.pmList.AddItem stringdata ' pmList is a stock Access listbox.
>
> It takes 3 MINUTES to run and finish the loop. The listbox is without
> question the problem. When I let the painting code run, I see the
> listbox repaint on each addition. At first it runs fairly quick.
> (Flickers like mad.) After about 75 records, on each add, it gets
> noticeably slower ON EACH SUCCESSIVE ADD. When there are less than 75

Why use .additem at all?

Change the row source type to Table/Query and the Row Source to your
query's name.
Commas do not bother a listbox when fed from a table or query.
Stand back and be amazed at how fast the listbox will load.