Shutdown Access application when a modal form is showing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rdemyan via AccessMonster.com

    #1

    Shutdown Access application when a modal form is showing

    I have a forced logoff routine in place that works well unless an Access
    messagebox is showing in the front-end that the routine is trying to shut
    down. It doesn't work use Access commands to shut down the application.

    Is there a way to use a Windows API to shutdown the application? I'm hoping
    that, like the task manager, a Windows API shutdown would work even if a
    modal form is displayed in the application it is trying to shutdown.

    The code to shutdown the application would be within the application, so I
    don't know if this is a problem or not.

    Thank you.

    --
    Message posted via AccessMonster.c om
    TRIBUN855 menghadirkan informasi lengkap seputar permainan online terbaru, akses VIP player, game online gratis, permainan tanpa uang asli serta berbagai fitur dan mekanisme permainan digital.

  • Albert D. Kallal

    #2
    Re: Shutdown Access application when a modal form is showing

    A model form should work ok. A dialog form, no dice.

    You can use the windows task manger to blow out a running applications, but
    then that is a sure fire way to damage and current a database file.

    Using the task manger to kill a running applications mans that you can't
    ensure that ms-access will complete its disk operations, and that equates to
    damaged files.

    I suppose if you kill a word processor running, then again the changes will
    not be saved So, you are playing to brute force fire here...

    I would simply dump the use of dialog forms in your applications. Use of
    model forms should work just fine however, and if you execute a quit command
    in the application, then things will be saved if you exit....
    ...

    You can read about the difference between dialog forms, and model forms
    here:


    --
    Albert D. Kallal (Access MVP)
    Edmonton, Alberta Canada
    pleaseNOOSpamKa llal@msn.com



    Comment

    • rdemyan via AccessMonster.com

      #3
      Re: Shutdown Access application when a modal form is showing

      Yes, I considered maybe implementing a custom messagebox, but it would be
      "after the fact". After the fact that I have about 150 forms and I would
      guess at least 1000 instances where a messagebox could be called. Even if I
      come up with a clever Find/Replace to change these out to the custom message
      box, I would still have to test them all and that doesn't seem to appealing.

      You day sure fire way to damage a current database file. This would be a
      front-end file in .mde format. Do you think the back-end could possibly be
      damaged with a "hard" shutdown.

      Thanks.

      Albert D. Kallal wrote:[color=blue]
      >A model form should work ok. A dialog form, no dice.
      >
      >You can use the windows task manger to blow out a running applications, but
      >then that is a sure fire way to damage and current a database file.
      >
      >Using the task manger to kill a running applications mans that you can't
      >ensure that ms-access will complete its disk operations, and that equates to
      >damaged files.
      >
      >I suppose if you kill a word processor running, then again the changes will
      >not be saved So, you are playing to brute force fire here...
      >
      >I would simply dump the use of dialog forms in your applications. Use of
      >model forms should work just fine however, and if you execute a quit command
      >in the application, then things will be saved if you exit....
      >..
      >
      >You can read about the difference between dialog forms, and model forms
      >here:
      >http://www.members.shaw.ca/AlbertKal...log/Index.html
      >[/color]

      --
      Message posted via AccessMonster.c om
      TRIBUN855 menghadirkan informasi lengkap seputar permainan online terbaru, akses VIP player, game online gratis, permainan tanpa uang asli serta berbagai fitur dan mekanisme permainan digital.

      Comment

      • Albert D. Kallal

        #4
        Re: Shutdown Access application when a modal form is showing

        Yes, you certainly reduce the possibility of damage if the application is
        split, but the problem still remains.

        I just don't have a solution for you (and, I agree 100% with you, trying to
        modify all of the msgboxes is just not reasonable solution here).

        I have several applications in which I also use a "hidden" timer form to
        exit the application (after one hours of in-activity...it shuts down).

        For the most part users do NOT wind up sitting at some msgbox prompt. On the
        other hand, I certainly made a LOT of efforts to remove those msgbox
        (dialog) prompts. For example, I used display a message that a record has
        been successful deleted. (well, that just annoyed users). I used have
        another msgbox that would explain that after removing people from the hotel
        room, that the room has just been retuned to the available list of rooms. It
        turns out that MOST of these messages were not needed, and thus I have
        SUBSTANTIALLY remove the number of msgbox prompts in my applications.

        You can be editing a new customer...and if you go for lunch..and my hidden
        form shuts down the application, then that customer is saved. And, I did not
        put in a bunch of VERY annoying save prompts etc. It is when you start
        throwing in all kinds of EXTRA dialog prompts like "do you want to save"
        that this breaks down. MS-access by default does not prompt to save, and
        most new applications such as pda's, and Smartphone also have eliminated
        these extra "ANNOYING" prompts. Removing these prompts makes the application
        so much more easy to use, nags the user less, and ultimately allows the
        applications to be shutdown by code gracefully also.

        So, about my only suggestion here is to remove things like save prompts and
        eliminate any extra dialog prompts - your users will love for this decisions
        anyway. Train users to use the undo if they don't want save their changes,
        but for the 99% of the time...don't nag with dialogs....

        --
        Albert D. Kallal (Access MVP)
        Edmonton, Alberta Canada
        pleaseNOOSpamKa llal@msn.com



        Comment

        Working...