Results 1 to 5 of 5
  1. #1
    BrightSoftware is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    45

    How to catch windows close (WM_CLOSE)


    Does someone have the code to catch the windows close command?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    Do you want to catch Access closing , or some other app?

  3. #3
    BrightSoftware is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    45
    I want to catch if another app tries to close access

  4. #4
    BrightSoftware is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jun 2016
    Posts
    45
    The problem we have is that a terminal server can close a session after x hours of inactivity.
    When there are open database connections the database sometimes gets damaged.
    Relations between a few tables get lost.
    When I can catch the the windows close, I can close all open forms.

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Sounds like what you actually want is code to close your database 'nicely' after a specified period of inactivity and before terminal server does so less nicely.
    I have code to do this but it's fairly embedded in my app and specific to that
    If you do a forum search you should find something suitable
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Paused Access macro while programming action catch up
    By johnseito in forum Programming
    Replies: 3
    Last Post: 04-10-2018, 08:30 AM
  2. ADP catch-22
    By daverj in forum Access
    Replies: 1
    Last Post: 05-20-2014, 11:30 PM
  3. Catch empty search result
    By octsim in forum Programming
    Replies: 5
    Last Post: 12-02-2013, 02:23 PM
  4. Replies: 4
    Last Post: 11-02-2012, 11:00 PM
  5. How to catch oracle exception error
    By nvrwrkn in forum Programming
    Replies: 2
    Last Post: 10-09-2012, 06:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums