You can't exit ms access now

mjb51

New member
Local time
Today, 03:50
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
 
Has it actually completed your print request when you get this message?
 
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.
 
Yes the report does print. The quit command will not close access due to the error.
 
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.
 
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

Back
Top Bottom