You Can't Exit Microsoft Access Now

C

ChuckW

Hi,

I have an access database that is designed to run a report and create a pdf
file. I have an autoexec macro that will open the form and print it. My
final step in the autoexec macro is to exit the application. I placed a
delay so that the database would have time to create the pdf file from the
report. If I don't have this in, it closes the program before it is written.
I wrote a module and stuck the step into my autoexec macro before the exit
step. The code is below:
------------------------------------------------------------------------------
Public Function testCDO()


Dim Finish As Single
Finish = Timer + 60
DoEvents
Do Until Timer >= Finish
Loop


End Function
-----------------------------------------------------------------
I am getting an error that says "You Can't Exit MS Office Access Now. If
your running a VB module that is using OLE or DDE, you may need to interrupt
the module. The program does generate the pdf file but I have to mannualy
click OK to exit. Can someone help?

Thanks,
 
B

Boyd "Hi Tech Coach" Trimmell via Access

I have found that avoiding macros make my like a lot easier.

I use a form to the is the startup form and in the form's on open event, I
run my VBA code them exit the database. I generate report snapshots and
PDF's, send emails, etc and how no issues like you described. I also use NO
macros.

Hope this helps ...
Hi,

I have an access database that is designed to run a report and create a pdf
file. I have an autoexec macro that will open the form and print it. My
final step in the autoexec macro is to exit the application. I placed a
delay so that the database would have time to create the pdf file from the
report. If I don't have this in, it closes the program before it is written.
I wrote a module and stuck the step into my autoexec macro before the exit
step. The code is below:
------------------------------------------------------------------------------
Public Function testCDO()


Dim Finish As Single
Finish = Timer + 60
DoEvents
Do Until Timer >= Finish
Loop


End Function
-----------------------------------------------------------------
I am getting an error that says "You Can't Exit MS Office Access Now. If
your running a VB module that is using OLE or DDE, you may need to interrupt
the module. The program does generate the pdf file but I have to mannualy
click OK to exit. Can someone help?

Thanks,

--
Boyd
Hi Tech Coach
http://www.hitechcoach.com

Message posted via AccessMonster.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top