Results 1 to 10 of 10
  1. #1
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149

    Report not printing sub report

    Hi Guys,



    I managed to sort out the statements report to show everything I want but when I print it doesn't print the subreport.

    I have a print button with the following code:

    Private Sub CmdPrint_Click()
    DoCmd.OpenReport "StatementsReport", acViewPreview, , , , acHiden
    DoCmd.SelectObject acReport, "StatementsReport"
    DoCmd.RunCommand acCmdPrint
    End Sub

    Click image for larger version. 

Name:	statement problem.JPG 
Views:	10 
Size:	64.7 KB 
ID:	35634

  2. #2
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    The image is of the report preview, the Current, 30 days,60 days and 90 days totals do not print.

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    does the subreport have data?
    is the subreport visible?
    is the subreport linked to the master report?

    preview:
    docmd.OpenReport "rMyReport",acViewPreview

    print:
    docmd.OpenReport "rMyReport"

  4. #4
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    Yes it is visible
    Yes there is data
    Yes it i linkedIt displays fine in preview mode showing everyting fine...just printing it is not working right

  5. #5
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Check the Display When property for the subreport is set to Always rather than Screen only.

    BTW your two 'horizontal' lines are wonky. Suggest you change height of each to 0
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  6. #6
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    Hi Ridders, it is set to always

    Click image for larger version. 

Name:	properties.JPG 
Views:	9 
Size:	49.7 KB 
ID:	35635

  7. #7
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Another theory bites the dust!
    Actually if it had been screen only, it wouldn't show in print preview anyway.

    Unless anyone else has any bright ideas, suggest you post a cut down copy of your database with report/subreport and anything needed to use it.
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  8. #8
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    YAY!! Got it to work with a workaround

    I removed the subreport from the main report.
    Told the main report to open the subreport in print preview mode as hidden when it loads
    Added text boxes to the main report which pulls the values I need from the sub reportW
    when the main report closes it closes both the main and subreport

    Works perfectly for viewing and printing.

  9. #9
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Glad you got it working. That is to put it mildly a rather strange solution ....
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  10. #10
    Freddie81 is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Mar 2018
    Posts
    149
    LoL, I decided the subreport in the main report isn't working, it kept showing duplicate records from the query as well and if I set it to not show duplicates it printed blank pages

    Now I have to write code that checks a combo box for "All Customers" and then runs and prints the report for every active customer directly without opening multiple print previews......

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Report printing extra pages of the same report.
    By khughes46 in forum Reports
    Replies: 5
    Last Post: 06-19-2014, 07:39 AM
  2. Printing report
    By undee69 in forum Forms
    Replies: 1
    Last Post: 06-26-2012, 08:10 PM
  3. Report printing
    By Andrevw in forum Reports
    Replies: 1
    Last Post: 01-16-2011, 06:08 PM
  4. Sub Report within Report not printing
    By LoggyDoggy in forum Reports
    Replies: 1
    Last Post: 04-20-2010, 01:39 PM
  5. Report Printing
    By newtoAccess in forum Reports
    Replies: 5
    Last Post: 12-02-2009, 07:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums