I am showing a modal form that has a ListView object on it. The user can select a row there and then presses the "OK" button in order to close that modal form ("unload me" is called in the cmdOkay_Click procedure) and to return to the non modal form.

Now back in the non modal form, I need to know what row the user selected and the text of that row.

What's the best way to pass such information to outside of the modal form? I tried to make a global variable of type ListItem and executing

set g_SelectedListItem = ListView.SelectedItem

before unloading the form. However, when accessing that variable back in the non modal form, I get an error stating that the object has been deleted (i guess the set statement just creates a reference, not a copy - right?).

Thanks for help!
Felix