Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Printing Multiple Reports in Access - 1 missing when printed - OK when previewed

Posted on 2008-06-10
5
Medium Priority
?
275 Views
Last Modified: 2013-11-28
I have a series of 5 Access reports that should be printed in a sequence.
With 4 everything works well, but adding the 5 does not work when printing - Previewing is ok.

Private Sub cmdPrintAll_Click()
On Error GoTo Err_cmdPrintAll_Click
 
    Dim stDocName As String
    Dim PrintParam
    
    PrintParam = acNormal
    
'    PrintParam = acPreview
    
    stDocName = "rptKPI123"
    DoCmd.OpenReport stDocName, PrintParam
    stDocName = "rptKPI4"
    DoCmd.OpenReport stDocName, PrintParam
    stDocName = "rptKPI56"
    DoCmd.OpenReport stDocName, PrintParam
    stDocName = "rptKPI7"
    DoCmd.OpenReport stDocName, PrintParam
    stDocName = "rptKPI8"
    DoCmd.OpenReport stDocName, PrintParam
    
Exit_cmdPrintAll_Click:
    Exit Sub
 
Err_cmdPrintAll_Click:
    MsgBox Err.Description
    Resume Exit_cmdPrintAll_Click
    
End Sub

Open in new window

0
Comment
Question by:IbDyhr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:GRayL
ID: 21756120
No point in declaring PrintParm and setting it = acPreview.  Try replacing PrintParm in each of the DoCmd lines with acPreview.  Why complicate matters any more than they need be.  Assuming 'Adding the 5' means Adding the 5th - rptKPI8 - does rptKPI8 have any data, and is there code that says if no data cancel the print?
0
 

Author Comment

by:IbDyhr
ID: 21756154
I only added the PrintParm to make it easier to wswitch between acPreview and acPrint to test if preview worked when print did not, and replacing it with what was originally acPrint makes no difference.

Yes you are right - it WAS adding the 5th report.

All reports take data from the  same open (tabbed) form in the same way, and there will always be data. No code for cancel if no data.

Cheers,
Ib
0
 
LVL 44

Accepted Solution

by:
GRayL earned 1500 total points
ID: 21756207
>replacing it with what was originally acPrint makes no difference<
--------------------------------------------------^--did you mean acPreview?
0
 

Author Comment

by:IbDyhr
ID: 21756220
sorry - acNormal it was.

I want the reports printed, but as the last one did not turn up I tried the acPreview, where it DID turn up.

However, in the meantime I have discovered, that the missing, 5th report is actually being sent to a different printer, as my testprint of it earlier was on a colourprinter (for shows).

So I believe it was all a storm in a teacup, but thanks for you help anyway - you will get my points.

Thanks,
Ib
0
 

Author Closing Comment

by:IbDyhr
ID: 31465986
Can only say "Partially" as you did not have all the details needed.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question