You can't exit ms access now (1 Viewer)

mjb51

New member
Local time
Today, 15:49
Joined
Jan 29, 2009
Messages
3
I'm calling a simple macro using the ms runtime. The macro does an 'Open Report", "RunCommand" to print, then "quit". I receive the following error: you can't exit access now. If you are running a visual basic module that is using OLE or DDE you may need to interrupt the module.

How do I solve this?
Thanks
 

Balr14

Registered User.
Local time
Today, 16:49
Joined
Oct 30, 2008
Messages
34
Has it actually completed your print request when you get this message?
 

boblarson

Smeghead
Local time
Today, 14:49
Joined
Jan 12, 2001
Messages
32,059
Insert a VBA module and name it modFunctions and then put these two procedures in:

Code:
Function PrintReport()
   DoCmd.OpenReport "YourReportName", acViewNormal
   Call ExitDb
End Function

Function ExitDb()
   Application.Quit
End Function

And call the function PrintReport and that should take care of it for you.
 

mjb51

New member
Local time
Today, 15:49
Joined
Jan 29, 2009
Messages
3
Yes the report does print. The quit command will not close access due to the error.
 

Balr14

Registered User.
Local time
Today, 16:49
Joined
Oct 30, 2008
Messages
34
What boblarson said. Print is an external OLE/DDE function and macros don't handle them well. Besides, even if it did work, odds are good it won't with the next upgrade.
 

Gori

New member
Local time
Today, 14:49
Joined
May 17, 2010
Messages
1
Somewhat similar situation.
I am researching an Access solution and have some missing libraries. I don't really want to spend time on getting the right libraries, I just need to be able to look into code and tables which works pretty well.
However it won't let me close the database or exit the application opening up some functions and complaining about those missing libraries.
 

Users who are viewing this thread

Top Bottom