using Application.quit causes fatal crash an error message in load event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi Al

I have an application which uses a couple of application.quit instructions

These are called via function calls(function in module) placed in the begining of the "on load" event of the forms

i am finding that forcing the application to quit in this way often causes fatal error messages, i.e

"Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience

then tries to send error report an proceeds to back up an fail to recognize various links, clearly this will not do for a commercial application :

Any comments appreciated

Cheer

Dotun
 
Instead of Application.Quit, try:
DoCmd.Quit

It would also be a good idea to explicitly save the record if your form(s)
could be dirty before issuing the quit.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

dotun said:
I have an application which uses a couple of application.quit instructions ..

These are called via function calls(function in module) placed in the
begining of the "on load" event of the forms.
i am finding that forcing the application to quit in this way often causes fatal error messages, i.e.

"Microsoft Access has encountered a problem and needs to close. We are sorry for the inconvenience"

then tries to send error report an proceeds to back up an fail to
recognize various links, clearly this will not do for a commercial
application :)
 
Hi Allen

a, Thanks, but I did start with docmd.quit. That works slower an permits the form "on load" code to execute complete, then it crashes anyway . application.quit seemed better initially.

b, I learned on some other website that one should always put quit commands at the end on a procedure ? comments ?

c, The form is a control switchboard, so the is no data to save: is data what you refer to as dirty ?

Cheers

Dotun
 
-----Original Message-----
Hi Allen

a, Thanks, but I did start with docmd.quit. That works
slower an permits the form "on load" code to execute
complete, then it crashes anyway . application.quit
seemed better initially.
b, I learned on some other website that one should always
put quit commands at the end on a procedure ? comments ?
c, The form is a control switchboard, so the is no data
to save: is data what you refer to as dirty ?
Cheers

Dotun
.
Hi Dotun,
a, have you considered incoporating error handling in your
code?

b, the aim is to have procedural logic flow down - not
jump back and forth, etc...

c, stating form is switchboard is new information, thus
dirty not relevant for form.

Luck
Jonathan
 
Hi Allen & Jonatha

It is the Access engine that crashes, not my code itself. This is a fatal untrapable error needing a work around

The crash seems to occur in the process off shutting down while

Have you heard of the "KillIT" function used to prevent an application running in the retail version of access
This also fails.

I suspect that my Windows/Internet explorer set up itself may be faulty, so i will try this out on an alternative machin

cheer
 
Dotun, have tried to follow up on this, without much success.

I don't think your issue is the same as:
http://support.microsoft.com/?ID=246953

In any case, double-check that you have downloaded the latest service pack
for Access/Office.

If you are seeing a message like, "Cannot find the file < file name > or one
of it's components," it's worth trying this:
1. Open Windows Explorer.
2. Choose Tools... Folder Options... File Types.
3. Locate and select MDB Microsoft Access Application on the list.
4. Select Advanced.
5. Select Open under Actions.
6. Select Edit.
7. Uncheck the check box next to "Use DDE".
8. Select OK.

You also want to make sure you're closing/freeing all database objects (set
db = nothing) before closing the database.
Not sure that's useful, but could not find much else.

Regards
--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

dotun said:
Hi Allen

a, Thanks, but I did start with docmd.quit. That works slower an permits
the form "on load" code to execute complete, then it crashes anyway .
application.quit seemed better initially.
b, I learned on some other website that one should always put quit
commands at the end on a procedure ? comments ?
 
Back
Top