Results 1 to 3 of 3

Thread: Trapping Time

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    8

    Question

    How can i trap the closing time of an application.

  2. #2
    Fanatic Member simonm's Avatar
    Join Date
    Sep 2000
    Location
    Devon, England
    Posts
    796

    Talking

    If you know which form will close last, use the Now() function to return the current date and time.

  3. #3
    Guest
    The Now function is good to capture both the date and time, or you can use the Time function to just capture when the app is unloaded.

    Code:
    'When X Button is clicked
    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Open App.Path & "\unloaded.txt" For Append As #1
    'Append is used if you want to add to the file
    'Output is used to overwrite the file
    Print #1, Now() 'or Time()
    Close #1
    End Sub
    
    'Or:
    
    Private Sub Form_Unload(Cancel As Integer)
    Open App.Path & "\unloaded.txt" For Append As #1
    Print #1, Now() 'or Time()
    Close #1
    End Sub

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