General information
Category:
Forms & Form designer
>>>>>I have a multi-selectable listbox on my form that I want to pre-fill when the form is loaded. I do this in the Init of the form, but by the time the form is activated the listbox has lost its values. Is there a better way of doing this? I don't know why it's losing its values.
>>
>>>>Are you using an array as your source? If so, it will lose scope when you leave the init of the form. Make the control source for the box an array that is a property of the form or a cursor.
>>
>>>Actually, the source is 6-Fields. It's coming straight from a table.
>>
>>Hello, Elyse.
>>
>>When you said that you pre-filled the listbox, we supossed that you were populating it item by item somehow.
>>
>>This have to work. Can you copy the init code? The only properties you have to set are: RowSource, RowSourceType, and Multiselect.
>
>Okay, I think I've narrowed down the problem, but I still can't solve it. My listbox loads properly with data from my table. I select multiple items and all is well. But if I deactivate and re-activate the form (i.e. by selecting another form and returning to the first one), the previously selected items in my listbox are no longer selected. How can I keep the items selected?
You save the listitemid's into an array and re-select the items on form.activate()
Previous
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