Results 1 to 2 of 2

Thread: queryunload versus unload events.. please clarify..

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Posts
    168
    Hello I have been using the form_unload even to save data from text boxes, etc in my form to a database. but i read recently that saving data should be in the queryunload event and that the unload event happens after the form is removed from memory. I have not had any problems using the unload event, the data is saving fine. can someone clarify the danger or the difference between the two? also, I when a user exits the program I have the form_unload event ask the "Are you sure you want to exit.." question, if they hit yes then it unloads, if they hit no, then the cancel is set to true. I read that that was also supposed to be in the query_unload and if you put it in the form_unload you should do a form.show command which I don't but it seems to cancel the exit just fine. Hope this all makes sense, Im just confused on the difference of the two since I haven't had a problem using form_unload.

    Thanks,
    Thai

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    One difference between the Unload and queryUnload events is that the latter lets you interogate the UnloadMode parameter to tell if it's your code, or the user, or a system shutdown, etc that is causing the form to be unloaded and that may make a difference in what you want to do at that point.

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