Temp store multiselect itemselected ??

G

Guest

Hi,

How do i in vba temporarily hold the selected values of a mulitselect
listbox while the listbox is being
required from another listbox for more values selection and once all wanted
values are selected,
I would like to insert them into a table by a click on a cmdbtn.
I think I would store them in an array but I read somewhere that
itemselected on a multiselect lstbox is already an array. But again, i will
be requirying for new values on the lstbox. It would be more than helpful if
someone can shed some light on how to hold the previous selected items on a
temp array for several requires on the lstbox before an insert is done via a
cmd button?
I already have the cmdbtn that can insert values from a mutlitselect listbox
into table.

Hope I have made myself clear on this. I would appreicate any help. Thanks
in advance.
 
P

pietlinden

Let me rephrase the question, because the description is about as clear
as mud.

You have a multi-select listbox and you want to store the values in the
ItemsSelected collection somewhere so you can store them between uses.

How you would do it would depend on how long you needed the
ItemsSelected groups to persist. I suppose you could create a
form-level collection and add the values to your collection in the
click event of a button. Otherwise, if you wanted to store them for
longer than that, you could create a table of (CollectionName,
ItemSelected) and then write to your table pretty easily. The upside
to writing the collection's contents to a table is that you could
reload the items whenever you wanted. (use a comobox that uses
something like "SELECT DISTINCT CollectionName FROM CollectionItems
ORDER BY CollectioName" as the rowsource, and then you could repopulate
the listbox on the fly.

Would be useful if you needed to create groups of items and reuse those
groups at a later date.
 
G

Guest

thanks pietlinden,
I guess should have posted this question after anlaysing my data insert
needs which I am yet to get around.
I may post back related questions to this when I'm actually working on the
case.

Thanks
 

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