mjb51
01-29-2009, 08:45 AM
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
01-30-2009, 07:22 AM
Has it actually completed your print request when you get this message?
boblarson
01-30-2009, 07:31 AM
Insert a VBA module and name it modFunctions and then put these two procedures in:
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
01-30-2009, 07:38 AM
Yes the report does print. The quit command will not close access due to the error.
Balr14
01-30-2009, 07:57 AM
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.
mjb51
01-30-2009, 08:06 AM
Thank you all for you help!
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.