After Decompile and Import all objects - Last form closes but leaves Access open

Rx_

Nothing In Moderation
Local time
Today, 09:21
Joined
Oct 22, 2009
Messages
2,795
Is there additional code to force Access to close?
After a decompile and Import All Objects (into new blank DB) the last form with the docmd.Quit closes the last form, but leaves Access open (blank).
Private Sub btn_close_Click()
DoCmd.Quit
End Sub

It is just the Access border, no menues, status bar with Ready.
Found a few people that had this problem after a decompile.
Nobody reported a solution.


History:
A form was mis-behaving. When it was copied, the original deleted then replaced with the copy, it would work a few times then corrupt again.

http://allenbrowne.com/ser-47.html
The steps are found here: https://www.fmsinc.com/microsoftaccess/errors/Bad_DLL_Calling_Convention.asp

Performed a decompile and import all objects into a new database.
For the new Access DB it requires - create the Startup Form (Home), setting the references, and setting all of the Access Options to exactly the same as the older DB project.
 
Maybe try Application.Quit instead of DoCmd.Quit? I read somewhere that despite those two do exactly the same, DoCmd.Quit is more for legacy purposes.
 
Was trying docmd.quit instead of docmd.close and it did indeed work!
There was no response, so I edited this to say the Application.Quit worked perfectlly.

This DB was Access 2000, moved up to 2007, then into 2010.
At each stage, and about Quarterly, I have Imported All Objects into a blank DB.
This would compress the DB from around 110 Meg into around 70 Meg in the way the compact and repair would not.
The only difference this time was to the additional decompile.

So much for the theory that the do.cmd.Quit and docmd.close for the last form.
I much prefer the Application.Quit. Will try it next (it worked).

Funny, it is only in one place, it has been working for 5 years, never paid attention to it. The VBA was updated a version when Access 2013 was installed on the workstation. Just wondering outloud if the new Tools Reference to the same name VBA might have made a difference?

There were several references to this same problem after a decompile. Just never saw a good answer on past post from a Google search.

Thanks
 
Last edited:

Users who are viewing this thread

Back
Top Bottom