echo problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is my code for creating a PDF using the click event of a command button:

DoCmd.Echo No
Application.Printer = Application.Printers("CutePDF Writer")
DoCmd.OpenReport "SymphonyInvoice1", acViewPreview
DoCmd.PrintOut
DoCmd.Echo Yes
DoCmd.Close

The <DoCmd.Echo No> does what I want...once. The next time I click the
button on any record, it doesn't work and I see everything I don't want to
see.

Why is that?
 
Well, never mind. I seem to have fixed the issue by using <Application.Echo
No> rather than <DoCmd.Echo No>.

I've noticed that others here have said to use "true" and "false" for Echo.
I'm using Access 2003 and true and false don't seem to work.

I'm also having an issue with error trapping. A CutePDF dialogue box comes
up during execution for saving the PDF. If the user clicks "Cancel" then Echo
stays off. I do have code to turn it on in an error event, but I don't know
how to capture the cancel event.
 
Back
Top