>>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?
>
>Elyse,
>With rowsource fields record pointer follows table. You would have to individually set each selected(itemid)=.T. AND you wouldn't set focus to listbox. When user sets focus to listbox by any means (click, tab etc) he loses the selections. A workaround is to not usng a listbox but a grid. See MultiselectGrid here in downloads section or an enhanced version at
www.foxyclasses.com . With grid all you need to set if a field flag.
>Cetin
whenever it seems that there is no better place for code
than in the activate, but you don't want that code executed
every time the activate event fires, just use a form-level
variable to control it ...
first_time_activated = .T. (user define form property , set at design time)
(in activate method):
if ( first_time_activated )
first_time_activated = .F.
... your "one-time-only" code here ...
endif
patrick