Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Category:
Coding, syntax & commands
Title:
Help populating a listbox
I'm trying to populate a listbox that has three columns. I set its columncount=3 and since I don't care to see the third column (but need it) I set the columnwidths="100,80,0". I want the list to be sorted by column 1 (some names) and items in it need to be able to be removed and/or added.
Now I populate the list by scanning thru a cursor and issuing three AddListItems - one for each column. This works and the list functions exactly as I require, but, it takes much longer to populate than if I were to instead set the list's RowSourceType=3 (SQL statement) and its RowSource to a string containing the select statement that generated the cursor that I was scanning thru.
Why is the latter so much faster? I've experimented with the list's sorted property when populating it with the first method but its slow either way. Also, when I populated the list using the SQL statement, I couldn't add or remove items using AddListItem or RemoveItem. So although it may be very fast to populate and display, its useless for my needs.
Anyone have suggestions as to how I may get a listbox to display its contents quickly and function the way I want?
TIA
Mike
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only