Rich P wrote:
Quote:
That I can think of, the loop is the only method of selecting items from
the listbox. I am curious what the objective is after you have selected
all of the elements. I picture a listbox with say 5000 items - all
selected now. What happens after that? Why not just select the items
directly from the datasource table? Note: If you have more than a few
dozen items displayed in a listbox at a time - you may want to rethink
your logic.
>
Usually, a listbox will be populated with a subset of data from a
dataset. A listbox is usually a filtered list from a dataset. Here is
a rule of thumb for RDBMS programming - if a single process (if you call
a procedure in a loop 1000 times - that is 1000 processes) is taking
more than a few seconds - it is time to rethink the logic.
>
Rich
>
*** Sent via Developersdex
http://www.developersdex.com ***
I was using a listbox with a Table/Query rowsource type. Due to the
complexity of the query it placed a drag on the form when I'd open the
form or refresh the data. I did various kludges with some improvement
here and there...then I decided to design a rowsource type as a
user-defined function. Doing so made my listbox(s) get a real energy
boost! It went from Drag to NoDrag.
I'm not a fan of large combos or listboxes. It overwhelms the vertical
scroll bars and is a pita for finding data using Table/Query rowsource
types. In the case of the OP I would suggest he look for the help topic
"RowSourceType Property (User-Defined Function) — Code Argument Values"
in Access help and if he/she's a worthy programmer and can follow
instructions/example then try it out and see if that gives a boost to
the process. I'll guess as to why it's faster...instead of disk based
retrieval of records the data in the list box is in memory.
SuperStar
http://www.youtube.com/watch?v=J_3zRh6HeZs