Database window in report

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

Guest

I have the following code on a command button in a form:

DoCmd.SelectObject acReport, "rptName", True
DoCmd.PrintOut , acPrintAll, , , Me.Copies, 0

It prints out the report as many times as the number in the text field
"copies". This works great, thanks again to those who helped me with that
one! However, when it does this, it opens the database window. What can I
use to prevent this or turn the database window back off again when done
printing. I tried changing the "true" to "false" but then nothing prints at
all.

Thanks for you help!

at
 
at:

Without going to a lot of windows api code to do it, your easiest solution
is to:

1.) Set Echo False before this code
2.) Use a series of select object calls after the fact to select forms you
want displayed on top of the db window
3.) Set Echo To true after the code runs.

What's important if you do this however is that you have good error handling
in your report code and in this module, and in the error handlers set Echo =
True, otherwise if any code you are running fails in the process the because
Echo is set to false the screen will not update and will seem "locked".
 
Ok, so now I have:

DoCmd.Echo False
DoCmd.SelectObject acReport, "rptName", True
DoCmd.PrintOut , acPrintAll, , , Me.Copies, 0
DoCmd.Echo True

However, it still shows the db window. The form with the print command
button stays open while it prints but it doesn't cover the database window.
It's set to autocenter and the db window shows up behind it and to the left.
What am I missing??

Thanks!
at
 
Back
Top