Results 1 to 6 of 6

Thread: [RESOLVED] when you shut down windows will this save my work

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Resolved [RESOLVED] when you shut down windows will this save my work

    when i shut down my computer will this save my work on exit
    or is there a better way?
    thanks

    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
        Call Savetime
        Unload Me
        End Sub

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: when you shut down windows will this save my work

    Form_QueryUnload is meant for cancelling the unloading (such as showing a "Are you sure you want to exit?" message), or potentially dealing with particular unloading modes (such as Task Manager is closing your app).

    As you aren't doing either of those, you should be using Form_Unload instead.

    Note that there is no reason to have Unload Me inside Form_QueryUnload. If you don't cancel via Form_QueryUnload, the form will unload automatically after Form_QueryUnload has been called.

  3. #3
    Addicted Member beic's Avatar
    Join Date
    Jun 2012
    Posts
    150

    Re: when you shut down windows will this save my work

    I agree with si_the_geek comment, but, Yes, Form_QueryUnload will save your work!

    Code:
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
     Call Savetime
    End Sub
    But to be shore, replace your function with Beep and test it!
    Last edited by beic; Jun 29th, 2012 at 11:11 AM. Reason: typo

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: [RESOLVED] when you shut down windows will this save my work

    hey yall how do you make a program run something when you hit close button.

  5. #5
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,929

    Re: [RESOLVED] when you shut down windows will this save my work

    If you mean the "X" in the title bar, that is what Form_QueryUnload and Form_Unload are for.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: [RESOLVED] when you shut down windows will this save my work

    ok cool thanks i think i got it, i put msgbox in there and its working

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