Link to home
Start Free TrialLog in
Avatar of dleads
dleads

asked on

Access print form crashes every time

Does anyone know why the DoCmd.RunCommand acCmdPrint or docmd.printout on a subform would cause Access to crash everytime?  Note, it crashes on certain computers and not others.

It crashes for me as well.  I have PDF as my default printer.  Others who crash do not.

I am trying to avoid creating a report.  Ideally, I want to be able to just print the form.


TIA
Avatar of Milton
Milton
Flag of Greece image

does it crashes on a specific subform or in others too?
Avatar of dleads
dleads

ASKER

Any subform with the printout command will cause it to crash.
Avatar of Jeffrey Coachman
dleads,

two things:
1. Clearly define  "Crash" (Lock-up?, Closes Access?, BSOD?)
2. Post the code that "Crashes"

JeffCoachman
Avatar of dleads

ASKER

Any time I hit the print button on the subform (using docmd.printout or DoCmd.RunCommand acCmdPrint ), the PDF creator window will pop up and then Access (not the pdf creator) will shut down.

Access actually crashes and gives the message... MS OFfice Access has encountered a problem and needs to close.  We are sorry for the inconvenience.  It gives the option to Repair.

I tried changing the default printer an XPS Document Writer, but that crashes also.
I also tried changing the default printer to an actual printer, and that crashes as well.
Avatar of dleads

ASKER

I should have added, we are actually printing before the crash happens.
dleads,

So this only happens when you print to a PDF?

Have you tried another PDF Utility?
(http://www.cutepdf.com/ , http://www.lebans.com/reporttopdf.htm)

Does this happen if you just print a standard Access Report?
Avatar of dleads

ASKER

This only happens when I try to use the docmd.printout or DoCmd.RunCommand acCmdPrint command on a form.  It doesn't matter what printer I send it to - it will always crash.

I can print reports with no trouble.
dleads,

OK, so can you try creating your pdf using another PDF creation program?

(Can you post the code you are using? most of the PDF printing programs simply allow you to print to a pdf file as if you were printing to a printer. So why are you using DoCmd.Printout?)

JeffCoachman
Avatar of dleads

ASKER

There is just the one line of code, on click event of a button on a form.  
The code is:
docmd.printout

The print will 'work' and then crash access.  It doesn't matter what printer is used or if we print to pdf.  The results are the same using this command.

I am able to print reports to pdf or printers, without any problems.

The purpose of having the docmd.printout was for simplicity.  I didn't want to go through the trouble of creating a report for this simple print method.  I have since created the reports, because of the crashing issue, but I would still like to find out how to fix this problem so that we are able to simply print a form using docmd.printout.

TIA
dleads,

Just for fun, try this:
   
    DoCmd.PrintOut acPrintAll

JeffCoachman
ASKER CERTIFIED SOLUTION
Avatar of Milton
Milton
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Miltiadis23,

Congratulations again!

... and welcome to EE!
;-)

JeffCoachman