473,396 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.com
http://www.accessmonster.com/Uwe/For...ccess/200603/1
Mar 31 '06 #1
3 3213
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

--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Mar 31 '06 #2
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:
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


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200603/1
Mar 31 '06 #3
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
pl*****************@msn.com
http://www.members.shaw.ca/AlbertKallal
Apr 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Jonathan Heath | last post by:
Hi all, I have created an ASP script that enters data into an Access Database. My problem is that I'd like this script to run when the computer is shutdown or the user logs off. I think...
8
by: Les Desser | last post by:
Is there any way to detect within A97 when Windows is trying to shut down, so I can close down the application gracefully? We currently have a trap in the main menu asking the user to confirm if...
5
by: will eichert | last post by:
Greetings. I have a problem with a combo box incorrectly displaying blank items when returning to a form from a modal form. It's fine when the main form first comes up, but gets messed up when the...
2
by: Shaun | last post by:
Ok here is the situation… Have an access 20002 application that I'm converting to have a SQL Server backend (2000), the application has been in use with an access backend for years, no real...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
3
by: Chris | last post by:
Modal forms are great for locking the user out of non focused forms allowing tight control over program flow, but they have one side effect which user find very irritating i.e. Access cannot be...
4
by: anders | last post by:
I have a 'solution' with a Webservice, Business layer and a data layer. In the Business layer I've added a form that need to be started on the server(this site has full rights, runs with Local...
1
by: Henry Lee | last post by:
hi , all This is driving me crazy , I use msgbox method in .net 2.0 environment and it is running fine on my IIS (Windows 2000) until today. The error is like "Showing a modal dialog box or form...
4
by: forest demon | last post by:
i've seen previous posts somewhat related to this, so i apologize if this is redundant. I have a main form with separate threads. When showing a dialog like <dialog>.ShowDialog(), it functions...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.