Howard Stern
Nov 1st, 1999, 08:26 AM
i have a modal form which is called from my main form via a command button. when the form is loaded a text file is opened and data is loaded into a form level public variable of a user-defined type. the type is declared globally in a module, however the actual variable is declared in the forms declarations section. the problem is, after the form is unloaded with 'Unload Me' the variable is not destroyed, so the next time the form is called the variable is holding unwanted data.
as a workaround i manually reset all the values in the Form_Unload event which works fine, but it seems sloppy. Shouldn't that variable be deleted when the form is unloaded? is manual removal the correct way to fix this?
as a workaround i manually reset all the values in the Form_Unload event which works fine, but it seems sloppy. Shouldn't that variable be deleted when the form is unloaded? is manual removal the correct way to fix this?