Report not printing

A

April

I have an Access application which includes a button on a
form to Preview a report. The Preview works fine, and
there is data in the report, however when I try to Print
the report, the "Now printing..." dialog flashes then goes
away and the report never gets into the print queue, thus
doesn't print. (If I open the report directly, I can print
it fine.) Any suggestions?

Note: here's my (auto-generated, except the Property ID
part) code for the button -

==========
Dim stDocName As String

stDocName = "PropertyInpectionReport"
DoCmd.OpenReport stDocName, acViewPreview, "PropertyID=" &
Me.PropertyID
=============

Thanks, April
 
D

Duane Hookom

Try add another comma
DoCmd.OpenReport stDocName, acViewPreview, , "PropertyID=" & Me.PropertyID
 
A

April

Duane,

Sorry, typo on my part when sending in this question. My
code does have the two commans between acViewPreview and
"PropertyID=" as your code suggests. Any other ideas? (I
use the same type of code on another button and it works fine!)

April
 
A

april

Yes, some code (no macros), mostly string concatenations
and field visibilities. But the report looks fine while
being "Previewied", it just doesn't go to the printer when
I do a File, Print (or even a <Ctrl><P>) if I've launched
the Preview request from a button (as described below) -
however, launching the Preview directly from the Reports
object window both Previews and Prints fine!
 
D

Duane Hookom

Is any of your code in the On Activate or On Open? What happens if you copy
all the controls and code into a new report?
 
A

april

Duane,

I tried copying everything to a new report and still the
same results: Prints fine directly from the report, but
not if I open the report in preview mode from a button.

I have a couple of variables set in the On Open event, that
basically are used to control the heights of sections or
the visibility of fields/sections.

April
 
D

Duane Hookom

The code in the On Open is most likely the culprit. You might want to try
move the code to the On Format event of the Report Header.
 
A

april

Duane,

Well, I had high hopes for your latest suggestion, but no
such luck. Same problem. I was able to catch a quick
glance at the print queue and the report briefly started
spooling into the queue, then just as quickly went away. I
don't think it's the printer per se, as I am doing other
reports in the exact same way and they are fine. As an odd
matter of fact, I have a button that prints directly (no
preview) the problem report along with another report that
isn't a problem, and they both print fine together! It's
just when doing the Preview mode from a button on a form,
then attempting to print. Again, a direct Preview of the
report from the report objects screen causes not problems.

Any other suggestions?!

April
 
D

Duane Hookom

You stated that you had some code in your report. It might help us if you
copied the code into a reply so we could view it.
 

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