Results 1 to 2 of 2

Thread: deleting global variables on form_unload

  1. #1

    Thread Starter
    Join Date
    Jun 1999


    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?

  2. #2
    New Member
    Join Date
    Feb 1999
    Redmond, Washington, USA


    i'm not sure if this will work but what if you declared a PRIVATE variable (of the public udt) in the form?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width