Getting List Box to load on startup

D

dhstein

I have a listbox on my main form that shows all products in the system. The
first time you access it and scroll down, it is slow - probably the items are
being read from the table into memory at that point. Once you've scrolled
all the way to the bottom, the items are all loaded and you can find any
product quickly and easily. My question is - is there a way to get the items
to load into memory when the form is opened so that this delay is not
noticed? Thanks for any help on this.
 
R

Rick Brandt

I have a listbox on my main form that shows all products in the system.
The first time you access it and scroll down, it is slow - probably the
items are being read from the table into memory at that point. Once
you've scrolled all the way to the bottom, the items are all loaded and
you can find any product quickly and easily. My question is - is there
a way to get the items to load into memory when the form is opened so
that this delay is not noticed? Thanks for any help on this.

Access saves resources by not retrieving rows that the user might never
try to access. When the form is opened only a subset of rows are
retrieved and more are fetched as the users scrolls down.

If you interrogate the ListCount property of the ListBox in code when the
form loads that will force it to retrieve all of its rows. Not really a
good idea in a network environment (IMO) unless you know that the user is
always going to need all the rows. Otherwise you are just needlessly
dragging data over the wire.
 
D

dhstein

Rick Brandt said:
Access saves resources by not retrieving rows that the user might never
try to access. When the form is opened only a subset of rows are
retrieved and more are fetched as the users scrolls down.

If you interrogate the ListCount property of the ListBox in code when the
form loads that will force it to retrieve all of its rows. Not really a
good idea in a network environment (IMO) unless you know that the user is
always going to need all the rows. Otherwise you are just needlessly
dragging data over the wire.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
Rick,


I had some problem seeing the discussions recently, but now I've
received your answer and it was very helpful, so thank you very much.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top